Combo Box Search Not Working

JSimoncelli

Registered User.
Local time
Today, 09:13
Joined
Apr 23, 2012
Messages
73
Hello All,
I am having an issue trying to create a Combo Box to use as a search device, selecting a “Control Number” from the Combo Box pull down and having that record displayed. I am using a Form setup as a “Review Form” I.E. all of the fields in the Detail section are locked to prevent inadvertent changing of the data. The table has several fields; the ones I am working with are MControlNum_ID (PK) and MControlNum (containing the data used as search criteria).
I have tried to use the wizard to create a search Combo Box but that does not seem to be working. I have searched for and found a couple of examples of code but I cannot get them to work.
The Combo Box is/was created in the Header section I have tried creating it the Detail section with the same results. I can get the Combo Box to display all of the "Control Numbers" in the pull down, but when I make a selection nothing happens. I have used the Afterupdate and OnChange events.
Thanks,

John
 
It would seem I have solved my own problem and it was quite simple. I don’t know why some of the other code I found did not work but the following did:

Created an unbound Combo Box, set the Row Control Source to a query on the MControlNum field. Using the AfterUpdate event,

Private Sub Combo61_AfterUpdate()
DoCmd.ShowAllRecords
DoCmd.FindRecord Me!Combo61
Me!Combo61.Value = ""
End Sub

Simple clean and best of all it works… I must say the people of this forum have inspired me to be efficient and I am more enthusiastic about Access and databases in general.

John
 
Sorry, this is sameless reply to get my post count to 10. This will allow me to add my email address.
 

Users who are viewing this thread

Back
Top Bottom