Entering data and other data is automatically generated.

  • Thread starter Thread starter JMill248
  • Start date Start date
J

JMill248

I am making a form where I enter a part number and its cost
automatically generates into another text box. How do you do that?
 
Do you have a table of the part numbers and their cost? Create a combo
where there are at least those two columns, then after update on the combo:
forms!myform!PartCost= cboPartNumber.Column(1)
where the first column (0) is the part number and the second (1) is the
cost.

With a list of valid part numbers users will have less of a chance of typing
something incorrect in the first place.

Mich
 
Do you have a table of the part numbers and their cost?  Create a combo
where there are at least those two columns, then after update on the combo:
forms!myform!PartCost= cboPartNumber.Column(1)
where the first column (0) is the part number and the second (1) is the
cost.

With a list of valid part numbers users will have less of a chance of typing
something incorrect in the first place.

Mich






- Show quoted text -

I don't want to createa combo box just a text field. I kind of
undestand That I have to create a function in the properties menu. Now
can you break it down again explaining how do you write it? For
example the function is ="Table name"."Field Name"
 
Use the dlookup function.

for example, you have text1 and text2

For numeric field
Me.Text2 = DLookup("RETURN_FIELD", "RETURN_TABLE", "RETURN_KEY= " & Me.Text1)

For text field
Me.Text2 = DLookup("RETURN_FIELD", "RETURN_TABLE", "RETURN_KEY= '" &
Me.Text1 & "'")

Modify that to your tables/fields/controls and drop that in whatever event
you want to trigger on, and you should be good to go.
 

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

Back
Top