Results 1 to 4 of 4

Thread: The details for the code..

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    26

    The details for the code..

    Hi,

    Could sombody let me know the details of the following code word by word:
    VB Code:
    1. Private Sub cboAccType_Click()
    2. Set rsTemp = New ADODB.Recordset
    3. rsTemp.Open "Select * FROM tblAccTypes WHERE AccountName='" & cboAccType.Text & "'", cnBank, adOpenKeyset, adLockOptimistic
    4. With rsTemp
    5. If .RecordCount > 0 Then
    6.     lblMin = !MinBalance
    7.     Else
    8.         Exit Sub
    9. End If
    10. End With
    11. End Sub



    Edit: Added [vbcode][/vbcode] tags for clarity. - Hack
    Last edited by Hack; Sep 22nd, 2005 at 08:27 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: The details for the code..

    VB Code:
    1. Private Sub cboAccType_Click()  '<== start of combo box click event
    2. Set rsTemp = New ADODB.Recordset '<== create new recordset object
    3. rsTemp.Open "Select * FROM tblAccTypes WHERE AccountName='" & cboAccType.Text & "'", cnBank, adOpenKeyset, adLockOptimistic '<== select all records from acctypes table that match what was selected from the combox box
    4. With rsTemp '<== Begins the with
    5. If .RecordCount > 0 Then '<== if records were returned
    6.     lblMin = !MinBalance '<== update a label with the contents of the field MinBalance
    7.     Else '<=== Else
    8.         Exit Sub '<== leave and dont do anything else
    9. End If '<== Ends the If
    10. End With '<== Ends the With
    11. End Sub '<== Ends the Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    26

    Re: The details for the code..

    Thanks a lot for your kind reply. Can I get some information regarding code like you have mentioned on any website plz.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: The details for the code..

    Quote Originally Posted by user3377
    Thanks a lot for your kind reply. Can I get some information regarding code like you have mentioned on any website plz.
    You can get information on it right here.

    What is your specific question or questions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width