Update macro

G

Guest

I am writting a macro that will delete, make a table and then append data to
another table for several tables. I unfortunately have to enter criteria on
for each of the make table queries that runs. The criteria is the same for
all the make table queries, beging date, end date and a type. Can I write a
macro that holds the criteria for each query and access it as it needs it?

Moses
 
T

tina

try calling the macro from a form, perhaps by clicking on a command button.
add unbound textbox controls to the form, and enter the criteria in those -
before calling the macro. in query design view, change the criteria to refer
to the form textboxes, with the following syntax, as

Forms!FormName!ControlName

hth
 
G

Guest

Can you please elaborate a bit more. I don't really understand how I would do
this with a command button. I would appreciate it if you could do a step by
step.

Thanks....sorry for all the trouble.
 
T

tina

create your form, with the combo boxes as i described. change the criteria
in the queries to refer to the form and its' combo box controls. you already
have your macro written, that performs the actions you want (i'll call the
macro "macTableSetup").

in the form design view, add a command button. in the Properties box, click
on the Event tab, and scroll down to the Click event. click on the event
line, you'll see a "down" arrow at the right side. click the arrow to see
the droplist, it will list all macros in your database. scroll down the list
until you find macTableSetup, and select it.

of course, you're looking for the "real" name of your macro, in the
droplist, and selecting it.

hth
 

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