Entering data and other data is automatically generated.

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?
 
M

M Skabialka

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
 
J

JMill248

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"
 
L

Lance

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.
 
Top