Hi,
How would I associate record in a database the the index of a command button? This is the I use at the moment
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.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
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




Reply With Quote