Combo box keeps returning first record in query

Richard M

Registered User.
Local time
Today, 11:00
Joined
Sep 29, 2010
Messages
75
I have a combo box that is driving me mad!

I am using A2007 and this one combo box is returning the first record of a query no matter what record I pick. My other combo boxes are working fine.

When I pick a record the "after event" works fine by placing the data in the proper text boxes and then returns the first record in the query.

Can anybody tell me what I should be looking for?

Thanks for the help.


Richard
 
Last edited:
When I pick a record the "after event" works fine by placing the data in the proper text boxes and then returns the first record in the query.
So this is the afterUpdate event of the combo box.
Can you show us the code for this event?
 
The following code is in the After Update event. I have ran the combo box without this code. I think it may be in the query itself. I also eliminated each code line until there was none and it still returned the first record of the query while populating the text boxes for the selection.

Code:
 Private Sub cboInvInfo_1_AfterUpdate()
Me.txtPoNUmber = Me.cboPOInfo.Column(1)
Me.txtProjectid = Me.cboPOInfo
Me.txtVendorName = Me.cboPOInfo.Column(4)
Me.txtDivisionName = Me.cboPOInfo.Column(5)
Me.txtPurchaseOrderID = Me.cboPOInfo.Column(7)
Me.txtContractorCCTID = Me.cboPOInfo.Column(8)
Me.txtTypeContractorID = Me.cboPOInfo.Column(7)
Me.txtProjectEngineerID = Me.cboPOInfo.Column(8)
Me.txtPOIAmount = Format(Me.cboPOInfo.Column(3), "standard")
Me.txtLedgerNoID = Me.cboPOInfo.Column(10)
Me.txtCCTIT = Me.cboPOInfo
DoEvents
Me.Refresh
DoEvents
 Forms!frmMainProjectForm!frmInventorySummary_subform.Requery
End Sub
 
Human error will always get you. The primary key set to auto number was in the middle of the query.
 

Users who are viewing this thread

Back
Top Bottom