Purdue22
05-11-2001, 09:07 AM
This is my situation. I created a form that provides me with record information from my Call Log table. I have a combo box with a list of dealers. In a seperate table called Dealer Info I have the fields: "Dealer", "Fax", "Phone#", and "Technical Communicator". When I select the dealer from the combo box I want it to automatically find the dealer in the Dealer Info table and place the Fax, Phone, and Technical Communicator in there respective text fields. Could you supply me with the code that accomplishes this.
Thanks
charityg
05-11-2001, 09:43 AM
combobox afterupdate
dim db as database
dim rst as recordset
set db=currentdb
set rst=db.openrecordset("dealertable")
rst.findfirst "[dealer]='" & combobox & "'"
with rst
if .nomatch then
msgbox "Dealer not found!"
else
me!fax=!fax
me!technicalcomm=!technicalcomm
me!phone=!phone
end with
[This message has been edited by charityg (edited 05-11-2001).]
Purdue22
05-11-2001, 10:30 AM
I am getting the error End with without With. Do you have any suggestions?
charityg
05-11-2001, 12:33 PM
combobox afterupdate
dim db as database
dim rst as recordset
set db=currentdb
set rst=db.openrecordset("dealertable")
rst.findfirst "[dealer]='" & combobox & "'"
with rst
if .nomatch then
msgbox "Dealer not found!"
else
me!fax=!fax
me!technicalcomm=!technicalcomm
me!phone=!phone
end if
end with
Sorry! I forgot my end if! I didn't guarantee the code would be bug free!