command button isn't working

N

Nydia

I have a database and i have a command button on the form.
on click this opens a report for the specific client on
the screen. it was working fine, but now doesn't work
after i did a compact and repair. here is the visual
basics code

Private Sub cmdBillingSheet_Click()
On Error GoTo Err_cmdBillingSheet_Click

Dim stDocName As String
Dim stlinkcriteria As String

stDocName = "rptBillingSheet"

stlinkcriteria = "[clientid]=" & Me![ClientID]
DoCmd.OpenReport stDocName, acPreview, , stlinkcriteria

Exit_cmdBillingSheet_Click:
Exit Sub

Err_cmdBillingSheet_Click:
MsgBox Err.Description
Resume Exit_cmdBillingSheet_Click

End Sub


what's wrong with it? any help is greatly appreciated
 
A

Alan

Do you mean a button in the worksheet or a UserForm button, if its a
worksheet button, right click it and re-assign the macro to it. This happens
when you do drastic things to the worksheet,
Regards,
 

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