Make Table query from a Linked Table

C

Conrad

Hello all,
I am trying to create a Form with a command button that executes a "Make
table" query with "date" criteria "Between [Forms]![Sales DB Creation]![Month
Start Date] And [Forms]![Sales DB Creation]![Month End Date]" that references
my date criteria off of a form.

The query has the date range I need, but when I execute the query I recieve
an error message with no detail what-so-ever, the error message is "Reserved
Error - (-7713); there is no message for this error". If I change the date
criteria to " Between 1/1/2007 and 1/31/2007" the query will run and create
my "New Table" based up my date fields.


Let me know some suggestions
 
J

John W. Vinson

Hello all,
I am trying to create a Form with a command button that executes a "Make
table" query with "date" criteria "Between [Forms]![Sales DB Creation]![Month
Start Date] And [Forms]![Sales DB Creation]![Month End Date]" that references
my date criteria off of a form.

The query has the date range I need, but when I execute the query I recieve
an error message with no detail what-so-ever, the error message is "Reserved
Error - (-7713); there is no message for this error". If I change the date
criteria to " Between 1/1/2007 and 1/31/2007" the query will run and create
my "New Table" based up my date fields.


Let me know some suggestions

First off... WHY do you want a MakeTable query? They are very rarely
necessary. If you need to generate a Report, export data, create
another query... you can do so from a Select Query; making it into a
MakeTable just adds (substantial) overhead and bloat in your database,
and leaves you with the dilemma of handling multiple identical tables
that just have different date ranges.

That said... try right clicking the table background and select
Parameters. Add the two forms reference parameters (copy and paste
them, they must be absolutely identical) into the left column of the
parameters grid, and select date/time as the datatype in the second
column.

Note that you can also save the user from having to remember the
number of days in the month ("Thirty days hath September, April June
and November..."): a criterion
= DateSerial([Enter year:], [Enter month number:], 1) AND < DateSerial([Enter year:], [Enter month number:] + 1, 1)

will let you select any desired month.

John W. Vinson [MVP]
 
M

Marshall Barton

Conrad said:
I am trying to create a Form with a command button that executes a "Make
table" query with "date" criteria "Between [Forms]![Sales DB Creation]![Month
Start Date] And [Forms]![Sales DB Creation]![Month End Date]" that references
my date criteria off of a form.

The query has the date range I need, but when I execute the query I recieve
an error message with no detail what-so-ever, the error message is "Reserved
Error - (-7713); there is no message for this error". If I change the date
criteria to " Between 1/1/2007 and 1/31/2007" the query will run and create
my "New Table" based up my date fields.


As long as the text boxes on the form have Date/Time values,
your original criteria should work. Are you sure that you
are entering full dates in the text boxes? Are the text
box's Format property set to a date type format?

There will be an type mismatch issue if the field with that
criteria is not a Date/Time field.

Your second try will not do what you want. Literal dates
need to be enclosed in the # date delimiter:
Between #1/1/2007# And #1/31/2007#
and the dates must be in USA style (mm/dd/yyyy) or an
unambiguous style (e.g. yyyy-mm-dd)
 

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