transform query into sub

  • Thread starter Thread starter nicolascaprais
  • Start date Start date
N

nicolascaprais

Hello,
I have created a set of queries and macros which "transform" a mother
database into different tables. My problem is that I want to know how I
can change a query into a module which will be commanded by a macro.
I need to do this because my database treatment will be automatical, and
when I put my query inside a macro, access asks me If I want to add the
lines to the tables and so on.
I want the user to be able to populate a table on a single click,
therefore I need to point the use of a button from the form on a macro
based on a module and not on queries.

The queries I use are quite simple, they use small function based on
Instr function, or the count function itself...
Can someone tell me how to write a code line which would perform the
same task as the query? After that I'll bind the action of the code and
the macro.

Thanks
nico
 
Nico

I suspect you are receiving a message that Access uses to warn you that
there will be changes (additions, deletions, updates) to a table. If you
don't want to see the messages, in your macro you can use the SetWarnings
command to turn off the warnings.

!!WARNING!! If you do not remember to turn the warnings back ON, you and
your users will not be able to tell when Access is not working correctly.
Use the SetWarnings command again, after your query is called, to turn the
warnings back on.

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top