what's wrong with this code??

aneats

Registered User.
Local time
Today, 09:59
Joined
Nov 13, 2002
Messages
70
this is a form, with 3 command buttons on it. this is the code behind the command buttons. the first opens the form "Part 3 financial details main form", the second opens "Payments & Receipts Main Form" as input only, and the third opens the form
"Assessment Navigation Form" as read only. ... well it's meant to. for the 2nd and 3rd i keep getting the message 'type mismatch'.
hope someone can help.


Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Part 3 financial details main form"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub


Private Sub Command5_Click()
On Error GoTo Err_Command5_Click

Dim stDocName As String
Dim acFormAdd As String

stDocName = "Payments & Receipts Main Form"
DoCmd.OpenForm stDocName, , , , acFormAdd

Exit_Command5_Click:
Exit Sub

Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click


End Sub


Private Sub Command7_Click()
On Error GoTo Err_Command7_Click
Dim stDocName As String
Dim acFormReadOnly As String

stDocName = "Assessment Navigation Form"
DoCmd.OpenForm stDocName, , , , acFormReadOnly

Exit_Command7_Click:
Exit Sub

Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click

End Sub
 
Remove....

Dim acFormAdd As String

and

Dim acFormReadOnly As String

You don't need to declare these.
 
thankyou!
 

Users who are viewing this thread

Back
Top Bottom