Calculating and Filling a Field Automatically.

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

Guest

So here's the situation. I have put together a table of information
concerning individual maps -"MapCat", which includes the field "Map No" (a
unique number for each map) which is in the format #.* The # refers the type
of map (in table "Map Type") and the * represents the number of maps of that
type. Example: a new topographic map added to the db will have the map No.
1.074, a new Land Use map will be 5.035.

My data entry subform has a drop down list of Map Types. After selection of
the desired type of map I want the following" Map No." field to display the
latest Map No (Appropriate for the map type) incremented by 0.001. I have a
query that calculates the latest Map No's for the different types of map but
do not know how to proceed.

Any help would be greatly appreciated.
 
If you mean, how do you get the information to show up after selection,
there are a couple of ways.
First, the field you want to update has to get it's information from a
query.
Preferably, the whole form is built on that query (you needn't limit
yourself to that
however, for the fields on the form, but 'building' the form from the query
makes
linking as I discuss below much easier).

You will then need to choose the event that will cause the update. Right
click
the MAPTYPES control on your form and go to events. Right click on "after
update" and click on "Event procedure". This will take you to the VBA
editor.
the only code you need is "Me.Refresh" <without quotes>. This will reload
the
information in the form, and rerun the query which should fill in your MapNo
field.

Scott

This should take <5 minutes...maybe 10 if you are a newbie. Trust the
wizards!
 
Back
Top