954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

need help for this please..very urgent

Its about visual basic.
I am making an application for loan system..
I don't know whats the code.
It goes like this, the situation is:
* Count how many times does the CO-Maker grant already a loan.

Need help for this.

shaileqs90
Newbie Poster
4 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

Going to need a whole lot more information than that to be able to figure out something! What code do you have so far?

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

>> I don't know whats the code.

so it is difficult to help you. take a help from any search engine.

abu taher
Practically a Posting Shark
845 posts since Jul 2008
Reputation Points: 14
Solved Threads: 78
 

This is assuming (TMOAF) that you are saving every loan approved by a user/CO Maker in a database, you can get its recordcount as such -

Rs.Open "SELECT COMAKER FROM LoansApproved WHERE COMAKER = shaileqs90"

Text1.Text = Rs.Recordcount

'LoansApproved will be your database name and COMAKER will be the user that approved the loan.


Is this what you were looking for?

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

This is assuming (TMOAF) that you are saving every loan approved by a user/CO Maker in a database, you can get its recordcount as such -

Rs.Open "SELECT COMAKER FROM LoansApproved WHERE COMAKER = shaileqs90"

Text1.Text = Rs.Recordcount

'LoansApproved will be your database name and COMAKER will be the user that approved the loan.

Is this what you were looking for?

Thanks for the reply..let me emphasized clearly.. i can't get the right code for this situation.
When a user process new loan for that person, there is also a co-maker (CoMakerNo - field on the table in the database).. this means that the co-maker has granted already 1 applicant/person..

for the next process of loan, with the same co-maker, this means that the particular co-maker has granted already 2 applicants and so on and so fort..

help me please..it would be much appreciated..thanks

shaileqs90
Newbie Poster
4 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

The way this site works is
1) You ask a specific question that can be answered.
2) You post the code segment that you are working on that doesn't work
3) You explain what it's doing wrong
4) You explain what it should be doing
5) Add any additional details that will help those if us that didn't write the code understand the code and the task.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

don't know if this is right..

cn.Execute "Select * from tblMaker where CoMakerNo = " & cboid.text

With rs
.AddNew
.Fields("CoMakerNo").Value = Me.cboid.Text
.Fields("Name").Value = Me.txtname.Text
.Fields("NoApplicant").Value = Val(rs.Fields("NoApplicant").Value + 1)
.Update
End With

shaileqs90
Newbie Poster
4 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

cn.Execute should be rs.open source, active connection, cursor type, lock type, options where...

source = "select *..."
active connection = cn
cursor type = [see help for this enum]
lock type = [see help]
options = optional parameter ususally left off

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

cn.Execute should be rs.open source, active connection, cursor type, lock type, options where...

source = "select *..." active connection = cn cursor type = [see help for this enum] lock type = [see help] options = optional parameter ususally left off

Good Luck


do you know the exact code for this situation..
i wrote the situation above..

:(

shaileqs90
Newbie Poster
4 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

in the code window, type in Dim rs As ADODB.Recordset and press F1. When the dialog comes up, select the VB one and the help file will tell you all the options and their meanings. Its a quick enough read...

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

Do you want people to do the whole lot for you?

If you want help at least try and be more specific about the problem.

floyd666
Newbie Poster
1 post since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

Hi,
I am also not sure if I can help you. vb5prgrmr and others mean to say that your code should be like

'Connect to DB
Dim CON As ADODB.Connection
Dim CMD As ADODB.Command
Dim RST As New ADODB.RecordSet
Dim conString As String
    
        conString = "DBQ=" & App.Path & "\Database.mdb" & "; Driver={Microsoft Access Driver (*.mdb)};"
    Set CON = New ADODB.Connection
    With CON
        .ConnectionString = conString
        .Open
    End With
Dim strSQL As String
    
    strSQL = "Select * from tblMaker where CoMakerNo = '" & cboid.text & "'"
    RST.Open strSQL, CON, adOpenForwardOnly, adLockOptimistic
'perform task if record.Eof is false    
If Not RST.EOF Then
With RST
.AddNew
.Fields("CoMakerNo").Value = Me.cboid.Text
.Fields("Name").Value = Me.txtname.Text
.Fields("NoApplicant").Value = Val(rs.Fields("NoApplicant").Value + 1)
.Update
End With
End If
'will disconnect from Database
    Set CMD = Nothing
    
    CON.Close
    Set CON = Nothing

Thanks

kinwang2009
Posting Whiz in Training
243 posts since Feb 2010
Reputation Points: 17
Solved Threads: 42
 

Need help very urgent with a program implementing day class..

James cuck
Newbie Poster
7 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: