By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,763 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

Need help displaying results of one query in command button

P: 3
Hello all. Access 2003/Windows XP.

I have set up a command button where three queries are run. The first and last queries are select and the second is an update. I only want to display the results of the last query to the user. Can someone help me out? Here's the code.

Private Sub btn_Submit_Click()
On Error GoTo Err_btn_Submit_Click

Dim stDocName As String

stDocName = "qry_Submit1"
DoCmd.OpenQuery stDocName, acNormal, acEdit

DoCmd.SetWarnings False
stDocName = "qry_Submit2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True

stDocName = "qry_Submit"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_btn_Submit_Click:
Exit Sub
Dec 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: 3
I figured it out...if I didn't have the table opened when I clicked on the command button I wouldn't need the third select query. Duh!
Dec 4 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
I figured it out...if I didn't have the table opened when I clicked on the command button I wouldn't need the third select query. Duh!
It's always nice when posters figure these things out for themselves. :)

Mary
Dec 5 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.