View Single Post
  #2   Report Post  
Alan
 
Posts: n/a
Default

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,
"Nydia" wrote in message
...
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