Should I change this code?

B

Bob V

Should I change 556 to 560???..............Thanks for your help..........Bob

Private Sub Command560_Click()
On Error GoTo Err_Command556_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmClientInfomation"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command556_Click:
Exit Sub

Err_Command556_Click:
MsgBox Err.Description
Resume Exit_Command556_Click
End Sub
 
J

John W. Vinson

Should I change 556 to 560???..............Thanks for your help..........Bob

Private Sub Command560_Click()
On Error GoTo Err_Command556_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmClientInfomation"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command556_Click:
Exit Sub

Err_Command556_Click:
MsgBox Err.Description
Resume Exit_Command556_Click
End Sub

No. You should instead change the name of the button Command560 to
cmdSomethingMeaningfulToYou. The GoTo lines and their corresponding labels can
be anything, but need to match. It's perfectly plausible to use

On Error GoTo Proc_Error
....
Proc_Exit:
Exit Sub
Proc_Error:
<error handling code here>
Resume Proc_Exit
End Sub

But using the default Commandxxx names gives you NO clue six months from now
what this command button is intended to do. Using a name like
cmdOpenClientInfo makes it much clearer what the button is meant to do.

John W. Vinson [MVP]
 
J

John W. Vinson

Thanks John I will change there names, that wont impact of my db
programme?.....Bob

Be sure that "Name Autocorrect" is turned *OFF* (it has been nicknamed Name
Autocorrupt for good reason), and use the binoculars in the VBA editor to find
and change any references to the code or the control name and fix them, and
you should be fine.

Wouldn't hurt to Compact the database when you're done, though.

John W. Vinson [MVP]
 

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

Similar Threads


Top