Command Button - using Queries

L

learning_codes

Hi,

I have about 40 Queries by Year. I don't want to write it down one
by one to make a command button.

DoCmd.OpenQuery "2007", acViewNormal, acEdit
DoCmd.OpenQuery "20071", acViewNormal, acEdit
DoCmd.OpenQuery "20072", acViewNormal, acEdit

I'm tired if I make the change then I have to go back the command
button to adjust the name of the queries.

Is there a way for create a code for "Like 2007*" or Like 2006* or
Like 2005* or Like 2004*, etc. in one command button.

DoCmd.OpenQuery "2007", acViewNormal, acEdit
DoCmd.OpenQuery "2006", acViewNormal, acEdit
DoCmd.OpenQuery "2005", acViewNormal, acEdit
DoCmd.OpenQuery "2004", acViewNormal, acEdit

Your help would be much appreciated.

Thanks
 

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