switchboard

G

Guest

I've created a Switchboard with 3 buttons. Each button calls up a different
data entry form. This is the error I'm getting "Invalid Procedure call or
argument". When you click on a button. I cannot find where the problem
lies.

Here is the code for a button:

Private Sub Test_Click()
On Error GoTo Err_Test_Click

Dim stAppName As String

stAppName = "W:\Profiling\QM_Log\CH_IMMU_RIPA_QM_FollowUp.mdb"
Call Shell(stAppName, 1)

Exit_Test_Click:
Exit Sub

Err_Test_Click:
MsgBox Err.Description
Resume Exit_Test_Click

End Sub
 
D

Dirk Goldgar

E-Mail Instructor said:
This is a test of replying to an article

It's very rude to post a test in response to someone who has come to the
newsgroup seeking help.
 
D

Dirk Goldgar

melwester said:
I've created a Switchboard with 3 buttons. Each button calls up a
different data entry form. This is the error I'm getting "Invalid
Procedure call or argument". When you click on a button. I cannot
find where the problem lies.

Here is the code for a button:

Private Sub Test_Click()
On Error GoTo Err_Test_Click

Dim stAppName As String

stAppName = "W:\Profiling\QM_Log\CH_IMMU_RIPA_QM_FollowUp.mdb"
Call Shell(stAppName, 1)

Exit_Test_Click:
Exit Sub

Err_Test_Click:
MsgBox Err.Description
Resume Exit_Test_Click

End Sub

You can't shell to a document, you have to shell to an executable. Try
this:

Dim stAppName As String
Dim stAccessPath As String

stAccessPath = SysCmd(acSysCmdAccessDir) & "\msaccess.exe"
stAppName = "W:\Profiling\QM_Log\CH_IMMU_RIPA_QM_FollowUp.mdb"

Call Shell(stAccessPath & " " & stAppName, 1)
 

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

PrintOut Code Error 2
Invalid Procedure Call or argument 1
Access 2003 6
Opening PDF link in Access 1
"Me" command in VB 3
Type Mismatch on Opening table 4
Opening a specific Word file 3
Using ntBackup 3

Top