Link master field to multiple child fields

B

BrentDA

I have a main form set up with a DATE combo box where I've manually keyed in
weekly date ranges so the end user can simply choose one of the date ranges
and fill in the rest of the form. I have the field identified as DATE on the
corresponding table.

I have multiple subforms of the main form which are accessed through a
'button' form.

My dilemma...the end user chooses a date on the main form, and I would like
to link the date they choose on that main form to a field (also called DATE
on all subforms).

I'm trying to make less keying work by having that date selected from the
main form and automatically placed in the DATE field of all the related
tables of the subforms.

As always, thanks in advance for your assistance !

Brent
 
J

Jeff Boyce

Brent

First things first...

If you have a field named "Date" (or more than one), you and Access are
going to get confused. "Date" is a reserved word, and Access may have
trouble understanding whether you are referring to its Date or your Date or
which one of your Date(s)...

So, go back through your table(s) and change the name of those "DATE" fields
to something a bit more descriptive (e.g., BirthDate, DateOfReply, ...).
Then modify your queries accordingly, and your forms.

Something else to be aware of ... if you use the Now() function to enter a
date/time value, it is entering a date AND a time value. Comparing a "date"
to a date/time value will only work if you are correct down to the second.
Check this to be sure your "date" fields hold only dates. And don't be
misled by the way the field is formatted. What is displayed (ala
formatting) is NOT what is stored.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

BrentDA

Thanks for your help Jeff. I've renamed the field in all the tables to MthDte.

Now to my original problem...I select a date range (from a drop-down in a
main form). From there I want the chosen date range (e.g., 2008 Jan 1-6) to
automatically be input in the MthDte field of the subforms.

How do I go about doing that?

Thanks !
 
J

Jeff Boyce

Brent

"How" depends on "what", and I'm not clear yet on what data you are putting
in to designate a "date range". Are you using one field and entering what
amounts to a text string, or two fields, entering something like [startdate]
and [enddate]?

And I guess I don't understand how a date range (2008 Jan 1-6) can be put in
an Access date/time field? It won't fit.

What am I missing?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Mike Painter

What is the relationships between the main form's table and the subform's
tables?
In general there should be no reason to have the same value in two places.
 

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