Record Selector Sync

jereece

Registered User.
Local time
Today, 15:55
Joined
Dec 11, 2001
Messages
300
I have a table with fields ID, NAME, ITEM, QUANTITY and DATE_IN. I have a query "qry_Logged_In" based on the table. I then have a form based on the query.

I created a combo box as a "go to record" selector and used the following Row Source:

SELECT DISTINCTROW qry_Logged_In.ID, qry_Logged_In.NAME, qry_Logged_In.ITEM, qry_Logged_In.QUANTITY, qry_Logged_In.DATE_IN FROM qry_Logged_In ORDER BY [ID];

On the After Update proceudre I have the following code:

Sub Combo135_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ID] = " & Me![Combo135]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

It works fine, but one thing I would like is that as I toggle through records using the record selector (forward/backward) buttons, I would like for the record number in my combo box to also change keeping in sync with the record number. Unfortunately, it currently stays to the number I last selected in the combo box.

Any suggestions on how to make the record number showing in my combo box to change with the record number?

Thanks,
Jim
 
Just wanted to ask for help again since no one replied.

Thanks,
Jim
 
Put in the Forms_Current Event:

Me.Combo135 = Me.ID

Dave
 
Oldsoftboss said:
Put in the Forms_Current Event:

Me.Combo135 = Me.ID

Dave

Thanks but where is this located? I can't find it.

Jim
 
Open up the form in design mode. Double click the small black square in the top LH corner of the form. This will open the forms properties. Click on the Events TAB, the first on the list will be the On Current event. When you click in the field a small button will be displayed on the RHS. Click on the button and if asked, select Code builder. The VB window will open, allowing you to paste the code.

Dave
 
Hmmm. I already have something in the "On Current" event. I am using a filtering addin, so my On Current event is "=aadHandleButtons([Form])".

Any other suggestions? I have done this before, but can't remember how I did it.

Thanks for the help.
Jim
 
Put that code in the event in the VB window also. The line in the forms On Current event property should read [event procedure]
 
When I move "=aadHandleButtons([Form])" to the VB window and use "Event Procedure" in the On Current event, I get error messages. Is there any other place I could put "Me.Combo135 = Me.ID" so that my combo box keeps up with the records as I navigate them?

Thanks,
Jim
 

Users who are viewing this thread

Back
Top Bottom