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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More Combo Boxes and DLooUp Help

Status
Not open for further replies.

webjunk

MIS
Dec 28, 1999
42
US
I was going through the previous question but I don't think that applies to me much. I have a table with my customers in it (tblCustomers) which have among other fields CustID and CustName. I have a data entry form (frmOrders) where there is a combo box (cmbCustID) that looks at the [tblCustomers]![CustID] for the Id Number and a text box [txtCustName]. I want to choose the CustID from the Combo Box and have the Customer Name appear on txtCustName so there wont be any errors. Thank You.
 
cmbCustID column count = 2

cmbCustID row source =
Select CustID, CustName from tblCustomers

cmbCustID After Update event =
txtCustName = cmbCustID.Column(1)

(column counting starts at zero)

Regards

Shep
 
You could try being a little more descriptive - how didn't it work?
Does it compile OK?
Does the combo row source work?
Does it perform the combo drop down OK?
Does it raise an error when you select?
Does anything appear in the text box?
Does it just not do anything?
Have you done what I suggested without any typos / slight amendments?

Shep

 
It doesn't compile.
The combo row source works ok
It performs the combo drop down ok
It doesn't raise an error when I select
Nothing appears in the text box
Nope, it doesn't do anything

The only thing it does when I put in to the event row is this: =[txtCustName]=[cmbCustID].[Column](1)

Any ideas?
 
On the event procedure line click the three little dots to the right + select Code Builder.

This should take you thru to the VBA editor with the following...
Private Sub Combo0_AfterUpdate()

End Sub

Put txtCustName = cmbCustID.Column(1) between the 2 lines so you get...

Private Sub Combo0_AfterUpdate()
txtCustName = cmbCustID.Column(1)
End Sub

Shep

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top