default values generated by related field selection

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

Guest

I am designing a database in Access 2000 that keeps track of ontime
performance for passenger trains operating in Canada. The database has
several tables (of course). The primary data entry form is a form/subform,
with the parent being the date of train operation, and the subform being a
table that holds records containing the trains operated that day and how they
performed. Another table contains information about the schedules of these
trains; I want the user to select a train, and then access to "fill in" the
default values for other fields in that record i.e. when I type or select
"27" from the dropdown menu (lookup to other table), Access enters the
scheduled departure and arrival times from the other table in to the related
fields in the train record table. The user could then modify these values
for that record if required...am I making sense?

In practice, far more trains are on time than late, so being able to do this
will significantly reduce the amount of keystroking required to enter the
data The user simply has to enter the train ID, and if the train was ontime,
the record will be generated without having to enter 10 more fields of data...

Thanks in advance for any help,

JDA
 
Hi.

Depending upon the way your subform is designed, you may use different
methods to fill the fields automatically. See Tom Wickerath's easy,
step-by-step tutorial on finding a record using a combo box on this Web
page:

http://www.Access.QBuilt.com/html/find_a_record.html

Or see the tutorial on "How to 'auto-complete' a form, with and without
code" by using an auto-query to automatically fill in information for new
records:

http://www.Access.QBuilt.com/html/forms.html#AutoCompleteForm

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
Somewhere, probably in the "table that contains information about the
schedules ..." the default values for each train must reside. The Combobox
must be based on a query that will return all of the fields you need from
the schedules table. In the AfterUpdate event of the Combobox you need a
line of code for each textbox you plan to fill:

me!txtA=MyCbo.column(1)
me!txtB-MyCbo.column(2)
etc.

HTH
 

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