ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   command button isn't working (https://www.excelbanter.com/new-users-excel/24241-command-button-isnt-working.html)

Nydia

command button isn't working
 
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

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,
"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





All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com