Results 1 to 40 of 46

Thread: [RESOLVED] Associate button index with record id in database

Threaded View

  1. #1

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Resolved [RESOLVED] Associate button index with record id in database

    Hi,

    How would I associate record in a database the the index of a command button? This is the I use at the moment

    Code:
     If rs.RecordCount > 0 Then
       'Check if the recordset contain records'
       If Not rs.RecordCount = 0 Then
       'Move to the first record'
          rs.MoveFirst
       'Loop till the recordset return EOF(end of file)'
          Do While Not rs.EOF And Not rs.BOF And Not i > rs.RecordCount
           Command1(i).Caption = rs.Fields("Name")
           Command1(i).BackColor = &H80FF&
           Entry.FillFields
       'Move to the next record'
          rs.MoveNext
          i = i + 1
         Loop
         rs.MoveFirst
         i = 0
        End If
     End If
    However, the record is progressed before the button index is changed and thus clicking the button populates the wrong data into the form compared to the associated record in the database.

    Edit:

    The attached project is a project I am helping forum member elRuffsta with.

    Edit II:

    if you make a choice after, the first two then it will display the previous choice rather than the current choice.

    Thanks,


    Nightwalker
    Last edited by Nightwalker83; Sep 23rd, 2014 at 06:24 AM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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