C
chris
Try this...
in the click event of the combobox put
if mycbo.listindex < 0 then exit sub
txtTerritory = dlookup
("[TerritoryField]","[AgentTable]","[AgentName] = '" &
mycbo.column(mycbo.listindex) & "'")
and similar for the agent id
three fields constitute a table, tblAgent, where AgentID
is primary Key) along With Customer Name, Customer Phone
Number etc.
automatically go to corresponding fields.
#etc.
right or not. And how can I achieve this goal?
in the click event of the combobox put
if mycbo.listindex < 0 then exit sub
txtTerritory = dlookup
("[TerritoryField]","[AgentTable]","[AgentName] = '" &
mycbo.column(mycbo.listindex) & "'")
and similar for the agent id
fields, say, Agent ID, Agent Name and Territory(those-----Original Message-----
I have three related fields in a form along with other
three fields constitute a table, tblAgent, where AgentID
is primary Key) along With Customer Name, Customer Phone
Number etc.
a combo box, then Agent ID and Territory of that agentTo make data entry easy, I want to choose agent Name from
automatically go to corresponding fields.
records, I have other fields like Customer Name, PhoneI find it is easy to do if the form has only those three fields.
Sub cboAgentName_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[strAgentName] = '" & Me! [cboAgentName] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
However, since my form is based on Customer Purchasing
#etc.
open a recordset, tblAgent. But I don't know if it isThe above code doesn't work anymore. I guess I need to
right or not. And how can I achieve this goal?