Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combobox to populate form 1

Status
Not open for further replies.

Ghostbeared

Programmer
Dec 17, 2010
1
US
All,
Here is my issue: MedInventory form with cboComName and cboClinName. These cbo's are in the form header. The enire form is based on a query. Selecting an item in either cbo is supposed to populate the entire form.
What is supposed to happen is:
cboComName populates the ComName textbox, as well as the other fields on the form (all from the query).
What happens is only the first record appears. When I select "Avelox" from the cbo, I get "Proscar" in the CmName textbox-which just happens to be the very first record in the table.
Here is the code I am using (Access 2007)

Option Compare Database

Private Sub cboCommon_AfterUpdate()
'Moves Description to textbox Common and finds
'the record of whatever item is selected in combo box
DoCmd.ShowAllRecords
Me!ComName.SetFocus
DoCmd.FindRecord Me!cboCommon

'Set Value of combo box equal to empty string
Me!cboCommon.Value = ""
End Sub
Any insight as to what is wrong? The cbo is unbound.
End Sub
 
To debug do this and see if the value of the combo is what you expect.

Me!ComName.SetFocus
msgbox Me.cboCommon
DoCmd.FindRecord Me!cboCommon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top