Using a macro to perform two tasks

G

Guest

Please can anyone help me with the following problem:-

I have created a Transactions form, where users can enter data when they
sell a shoe.
At the bottom of this form, I have two buttons, one to add the record to the
transactions table and one to run an update query, which updates the quantity
of stock in the stock table.
I have tried combining these two actions in a macro, but when I run it I get
the following error:-
"The command or action GoToRecord isn't available now."
How do I create a macro thats add a new record and runs an update query?

Thanks for all your help,
Louisa
 
S

Steve Schapel

Louisa,

You didn't tell us anything about the macro, so it is hard to comment.
Do you have a GoToRecord action in the macro? What other actions?
What event are you trying to run the macro on?

By the way, not thequestion you asked, but it is almost always invalid
to "update the quantity of stock in the stock table". This is the kind
of thing you see in spreadsheeets and stuff like that, but in a database
you shouldn't generally store derived data. You should be able to use a
query, based in the Transactions table, to return the current stock
levels whenever you need this information for your purposes on form or
report.
 
G

Guest

I have created a macro that will run when you click on the button in the form.
It adds a new record to a table by carrying out the following actions:-
(they were automatically created when I created a button using the wizard)
OnError (goes to next record in table)
GoToRecord
MsgBox
Then I wanted the macro to run the query by:- (this was also automatically
created when I created a button using the wizard)
OpenQuery
I would like to combine both of these macros but when I run it I get the
following error:-
The command or action GoToRecord isn't available now.
Thanks for all your help, Louisa
 
G

Guest

When I created a button using the wizard to add a new record to the table,
the macro included the following actions:-
OnError
GoToRecord
MsgBox

When I created a button using the wizard to run a query, the macro included
the following actions:-
OpenQuery

I would like to combine these two macros together, so when I press on one
button, it will run. However when I try to do this I get the following error:-
"The command or action GoToRecord isn't available now."

Thanks for your help, Louisa
 

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