validate date field against table name and update that table

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

Guest

I am looking to have an individual enter a specific date for a delivery and
upon clicking a button they all the fields on the form will update a table
with the name of the month of delivery.

For instance if they set the date of july 16 the system would look for a
table with the name of july and update that table. If the date was august 18
then the table with the name of august would be updated.

The delivery date is a textbox with the date format of 9/9/9999.

Thanks for your help.
 
I am looking to have an individual enter a specific date for a delivery and
upon clicking a button they all the fields on the form will update a table
with the name of the month of delivery.

For instance if they set the date of july 16 the system would look for a
table with the name of july and update that table. If the date was august 18
then the table with the name of august would be updated.

The delivery date is a textbox with the date format of 9/9/9999.

Thanks for your help.

so you have 12 identical data tables? Why? Just index on the month
and put all of it in one table. then you just need one append query.
Sounds like you're making a very simple thing very complicated.
 
I am looking to have an individual enter a specific date for a delivery and
upon clicking a button they all the fields on the form will update a table
with the name of the month of delivery.

For instance if they set the date of july 16 the system would look for a
table with the name of july and update that table. If the date was august 18
then the table with the name of august would be updated.

The delivery date is a textbox with the date format of 9/9/9999.

Thanks for your help.

Storing data - a month or a date - in a table name is VERY BAD design. That
design decision is the cause of your problem.

You can't do this with a query; you'll need to write VBA code to use

Format([datefield], "mmmm")

to extract the month name and incorporate it into the SQL.

*MUCH* better would be to do as Piet suggests and normalize your data. Put an
indexed MonthName field in the table - or perhaps just store the date. You can
retrieve just the July data using a query very easily.

John W. Vinson [MVP]
 
Back
Top