1

hey is there a way to only run a saved insert query in access 2013 from a comandbutton and not show it? I alredy have a query that workes if i execute it from the query itselfe but i cant get i working from the form

i have tried it with the vba methode

dbs.Execute and than the sql statement as string

but that doesn't work and i tried the

OpenQuery "myqry"

but that does only show me a table with the values i want to insert but doesn't realy insert them.

2
  • i want to insert but doesn't realy insert - so, do you want to insert ot not? Commented Jan 5, 2015 at 8:17
  • the query should insert and it does if it is executed from the query itselfe but when i trie to run in from the form with the "OpenQuery" methode it only showes the values insted of inserting them Commented Jan 5, 2015 at 8:19

1 Answer 1

1
DoCmd.OpenQuery ("myqry")

should be sufficient. Make sure that this code is assigned to the on-click event of your button. Another option is to assign a macro to the on-click event of your button for the same purpose. The macro can be selected from the dropdown list and is titled 'Open Query'. After selecting this macro, you need to select the query name and that's it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.