P
Pat Dools
Hello,
I have some code (see below) which simply opens the next form in a series
based on a lookup table that contains all forms in the database and their
assigned number. I am executing the code behind a Command Butoon and have an
'OnCLick' [Event Procedure]. When I click the button, I get the error, 'Type
Mismatch'. There's not a whole lot of code and the name of the Lookup Table
is correct, what might be the reason I get a 'Type Mismatch' error message?
(Code below):
Private Sub BeginSeries_Click()
On Error GoTo Err_BeginSeries_Click
Dim strSQL As String, strName As String, rst As Recordset, dbs As Database
Set dbs = CurrentDb
strSQL = "SELECT * FROM [LU_Forms] WHERE [FormOrder] = 2"
Set rst = dbs.OpenRecordset(strSQL)
DoCmd.OpenForm rst![FormName], , , , acAdd
Exit_BeginSeries_Click:
Exit Sub
Err_BeginSeries_Click:
MsgBox Err.Description
Resume Exit_BeginSeries_Click
End Sub
I have some code (see below) which simply opens the next form in a series
based on a lookup table that contains all forms in the database and their
assigned number. I am executing the code behind a Command Butoon and have an
'OnCLick' [Event Procedure]. When I click the button, I get the error, 'Type
Mismatch'. There's not a whole lot of code and the name of the Lookup Table
is correct, what might be the reason I get a 'Type Mismatch' error message?
(Code below):
Private Sub BeginSeries_Click()
On Error GoTo Err_BeginSeries_Click
Dim strSQL As String, strName As String, rst As Recordset, dbs As Database
Set dbs = CurrentDb
strSQL = "SELECT * FROM [LU_Forms] WHERE [FormOrder] = 2"
Set rst = dbs.OpenRecordset(strSQL)
DoCmd.OpenForm rst![FormName], , , , acAdd
Exit_BeginSeries_Click:
Exit Sub
Err_BeginSeries_Click:
MsgBox Err.Description
Resume Exit_BeginSeries_Click
End Sub