Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make-table query in macro under form button

Status
Not open for further replies.

Mross

MIS
Mar 31, 2000
3
0
0
US
I have a macro that runs just fine in ACCESS. This macro runs a make-table query and then copys the results to another table. When I connect this macro to a form button to run it, the macro runs with no errors but the make-table query returns no results. What obvious point am I missing?
 
Are you saying the maketable query makes a table but it contains no data?

To be sure, delete the new table and run the macro again.

Do you get the normal warnings for a maketable query?
 
Lupins46,

The macro, when initiated from the MACROS list in ACCESS runs just fine and produces a list of results. When it is put under a form button, same macro, it runds but the make-table is empty. The criteria for the make-table is provided by a form field...when running the macro from ACCESS, you must fill in the parameter...when the macro runs from the button, the parameter is feed from a form field. No errors are reported...I have echo off and setwarnings so that I don't see any prompts.
 
Then the problem is clearly the parameter value contained on the form.
What does the criteria expression say?
What datatype are you dealing with?
 
try opening the form and inputing the parameter into the text field, now open the macro and run whilst the form is still open. as Lupins said the problem sounds like its a parameter problem and something to do with the text field.
I suggest you begin with the basics. check the criteria of the query and that its pointing at the correct text field. then check the macro is running the correct query.
best thing to is get rid of the macro altogether and have the code of the button run the query.
cut out the middle man

Be ALERT - Your country needs Lerts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top