Make sure you're choosing the third option, "find a record..." It should show if the form is bound directly to a table. If not, I can dig up the code and we can adapt it.
Make sure you're choosing the third option, "find a record..." It should show if the form is bound directly to a table. If not, I can dig up the code and we can adapt it.
I was picking the wrong option. I did it again and now it created a macro. I have modified it, but it tells me my subform is not "open". I will continue to play with it, but thank you for getting me on the correct option to start with.
It shouldn't be referring to the subform, unless I'm goofed up on your setup.
How would it know which control the combo box should equal?
The combo is the control. The code should in essence say "take me to the record displayed in the combo" based on the employee ID field. What is the code behind the combo?
So here is where I am at this morning:
combo box [cmbLockSearch]. Row Source = SELECT qryLockSearch.LockNumber, qryLockSearch.ID FROM qryLockSearch ORDER BY qryLockSearch.LockNumber;
The [ID] is from tblAssociates and the LockNumber is from tblLocks. They are joined together in the qryLockSearch
My After Update function is:
Private Sub cmbLockSearch_AfterUpdate()
DoCmd.ShowAllRecords
Forms.frmAssociateTraining.frmLocks_sub.Form.LockN umber.SetFocus
DoCmd.FindRecord Me.CmbLockSearch
'Set value of combo box equal to an empty string
Me.CmbLockSearch.Value = ""
End Sub
When I select a lock number in the combo box, it acts like something is happening...I get a short delay, and there is a small symbol on the screen as if something is running in the background...this lasts about 1 or 2 seconds, and then nothing, and I am still on the same employee record.
Hold the Bus!!! I think I have it! I was trying to reference the subform in the After Update macro. I changed it to the main form, and then I am using the ID number to actually locate the LockNumber. That seems to have done it!
Thanks pbaldy for pointing me in the right direction!
Happy to help!