autopopulate

B

bridgeman

I am creating a data entry form to populate a main table. I am trying to get
2 forms in the field to auto populate with info based on the answer to a
previous field. Something like this in my activity code field If the entry is
487, then the next field (type of unit) should autopopulate Acre, the next
field (cost per unit) should autopopulate 398.99. I made a table just for
those fields. I just cannot get it to work right. There are other fields in
the form, but those will be entered manually.
Any insight. I am just learning access and any help is appreciated.
 
J

Jeanette Cunningham

Hi,
You can use a Dlookup on the table you created.
Something like:
If Not IsNull(Me.txtEntry) Then
Me.txtUnit = DLookup("[Unit"], "TheTableName", "[EntryFieldName] = " &
Me.txtEntry)
Me.txtUnitCost = DLookup("[UnitCost"], "TheTableName", "[EntryFieldName]
= " & Me.txtEntry)
End If

Note:
txtEntry is where you type 487
EntryField is the name of the field that has 487 in it

Jeanette Cunningham
 

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