autopopulate

N

Nick

I have a data entry form with several text and combo boxes, that are bound
to a table called "Jobs". I would like to autopopulate some information on
the form prior to users adding a record. There is a secondary table,
"JobInfo", that contains the following information:

JobNumber
Suffix
ItemNumber
Quantity

I would like for the user to be able to enter the JobNumber and Suffix, and
upon entering the suffix, to have ItemNumber and Quantity autopopulate. I
have written code to do this but it is returning a #NAME? error.

Could someone give me a bit of guidance? Any help would be appreciated.

Thanks in advance,

Nick C.
 
J

John Vinson

Private Sub txtSuffix_Exit(Cancel As Integer)
Me.Item__.ControlSource = "SELECT ItemNumber FROM JobInfo WHERE
(((JobInfo.JobNumber)=[Form]![QA Data Sheet]![Job__]));"
End Sub

So what is Item__? Do you have a textbox on the form named
Item<underscore><underscore>? And why would you want to set its
control source to a text string which just happens to be valid SQL?
(Doing so will not run the Query). Please explain what you're trying
to *accomplish* - that's not at all clear to me at the moment!
 
E

Emilia Maxim

Nick said:
I have a data entry form with several text and combo boxes, that are bound
to a table called "Jobs". I would like to autopopulate some information on
the form prior to users adding a record. There is a secondary table,
"JobInfo", that contains the following information:

JobNumber
Suffix
ItemNumber
Quantity

I would like for the user to be able to enter the JobNumber and Suffix, and
upon entering the suffix, to have ItemNumber and Quantity autopopulate. I
have written code to do this but it is returning a #NAME? error.

Nick,

please post the code and give some info how you're calling it,
otherwise we cannot see why it's returning this error. And do you have
some combos to enter the job number? I guess this would be best bet,
you could even display all other data in a row in the combo.

Actually, I should also ask, why do you want to store the same data in
two tables?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top