Auto entry if certain fields match previous entries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table (called Data) which contains the following fields...

Project Number
Floor
Version
Area
Daylight
Visibility

I am using a form to enter data into this table.

This is what I'm having difficulty with...
If the data entered into the first 3 fields (Project Number, Floor &
Version) matches a previous entry then the three remaining fields (Area,
Daylight & Visibility) should be filled in automatically to match.
I'm new Access and I'm not sure how to go about this, do I use dlookup or
something like that? Any ideas/help would be appreciated

Many Thanks

Martin
 
Sorry I forgot to mention there will be another field in the table (called
Population), which will be subject to change even if the first three entries
match a previous record. This is what I'm struggling to get my head around,
maybe it needs a different approach?
 
Yes, DLookup could be a useful way to go.
Since you have 3 fields which must match, and they can be filled in or
changed in any order, you'll need to run this "autofill" from a number of
different events. I'd suggest making a separate function (it can be in the
same form module), and calling it from each place.

BTW, what if somebody comes in later and changes one of the 3 "matching"
fields - do you reset the other 3 ones? Blank them out if there is no
match? Does this affect the Population box?
 
Back
Top