Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access XP - Command Button Wizard Problems

Status
Not open for further replies.

dcrosier

Instructor
Mar 17, 2000
51
0
0
US
I have been exploring Access 2002 and have found something, that I have not been able to get an answer about. Perhaps someone here can point me where there is more information.

I have created a macro that opens a form.

I can attach the macro to the onClick event and have the form open correctly.

However, if I attempt to create the macro button utilizing the Command Button Wizard, the code that is generated locks up Access. Frankly I don't see anything wrong with the code.
Code:
Private Sub cmdContact_Click()
On Error GoTo Err_cmdContact_Click

    Dim stDocName As String

    stDocName = "mfrmMyContact"
    DoCmd.RunMacro stDocName

Exit_cmdContact_Click:
    Exit Sub

Err_cmdContact_Click:
    MsgBox Err.Description
    Resume Exit_cmdContact_Click
    
End Sub
I have also noticed that I have periodically recieved an error message indicating that Visual SourceSafe Client is not installed

This is an Access 2000 database running under XP, which may be part of the problem.

Any suggestions?

Dawn
 
If you named your macro mfrmMyContact then it should work but that is a stange name for a macro. Developers use the naming convention frm to denote a form so if it is really a form they you have identified the problem.

Steve King Growth follows a healthy professional curiosity
 
You need to run the command button wizard again and select the option for opening a form, not running a macro.

Select "Form Operations" and "Open Form" then select the name of the other form that you want to open when the user clicks the command button.
 
Thanks so much! That worked just fine, you know how it is when you are experimenting with exercises from a book?

What is the deal with the Visual SourceSafe Client though? That is a new error message and I am not familiar with it.

Dawn

 
Sorry - don't have any experience with SourceSafe. It sounds like SourceSafe is not installed properly or that you have installed a version of full-blown Visual Basic that is conflicting with the Access/VBA installation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top