Action button problems :(

hayden

Registered User.
Local time
Today, 23:12
Joined
Mar 16, 2010
Messages
49
hi
i have created a button by a wizard in access 2007 on a form populated by a query, i have added a button so that it opens my invoice

however when we click the button nothing happens but my all my other buttons work
here is the code:

Private Sub Command17_Click()
On Error GoTo Err_Command17_Click


stDocName = "Appointments invoice"


Exit_Command17_Click:
Exit Sub

Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click

End Sub
 
is it a report or form?

you are missing the docmd for either one of those!
 
it is a report
 
ok then you are missing the

docmd.openreport stdocname, acviewpreview
 
could you add the new line into the existing code and paste it back so its in the right place please because im new to access
 
why not try it and see if you can figure it out? there is only one spot it can go where it will work... Otherwise, how will you learn?

hint... you declare stdocname="appointments invoice" and you use it in the line i provided

so therefore...
 

Users who are viewing this thread

Back
Top Bottom