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

Combo box reference fields

Status
Not open for further replies.

118600

Vendor
Feb 15, 2005
36
0
0
DE


Hi programmers,

I am not a programmer but i have to use some vba code in my application.
I have a problem in selecting combo box values in reference to other fields.

My table fields are like CustomerID, CustomerName, CustomerAddress

these fields are selected in a form.When i try to select a CustomerID(Combo Box) then i
am not able to get responded CustomerName and CustomerAddress.

I have tried to use VB Code like


CustomerID_BeforeUpdate(Cancel As Interger)


Dim strMsg As String, strTitle As String
Dim intStyle As Interger

If IsNull(Me!CustomerID) or Me!CustomerID = "" Then
strMsg = "a value must be picked"
strTitle = "Diplaying Customer Information"
intStyle = vbOKOnly
MsgBox strMsg, intTitle, strTitle
Cancel = True

End If

End Sub


Private Sub CustomerID_AfterUpdate()

Me!CustomerID = Me!CustomerID.Customer
Me!CustomerName = Me!CustomerName.Customer
Me!CustomerAddress= Me!CustomerAddress.Customer

End Sub


Anyone can help me ? i will be thankfull to you guys!
 
You may try to follow the combo wizard(3rd option I guess).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top