Terkle
Technical User
- Jul 22, 2007
- 18
Hello there
I'm trying to run a procedure but keep getting a 'type mismatch' error. To try and sort out the problem, I've created a 'test' db and made a simple table, query and forms and inserted the code below and it works fine.
Private Sub Form_Load()
Dim db As DAO.Database, rst As DAO.Recordset, strSQL As String
Set db = CurrentDb
Dim intNames As Integer
Dim rstNames As Recordset
Set rstNames = db.OpenRecordset("qry1Data", dbOpenDynaset)
intNames = rstNames.RecordCount
If intNames > 2 Then
MsgBox ("Blahhhhhhhhhhhh!")
Else
MsgBox ("Wooooooo!")
End If
End Sub
I imported all the objects from the 'test' db into the one I was having trouble in and when I try to open the same form that works in the 'test' db, i still get a 'Type mismatch' error.
Is anyone able to explain why this is happening?
Thank you
I'm trying to run a procedure but keep getting a 'type mismatch' error. To try and sort out the problem, I've created a 'test' db and made a simple table, query and forms and inserted the code below and it works fine.
Private Sub Form_Load()
Dim db As DAO.Database, rst As DAO.Recordset, strSQL As String
Set db = CurrentDb
Dim intNames As Integer
Dim rstNames As Recordset
Set rstNames = db.OpenRecordset("qry1Data", dbOpenDynaset)
intNames = rstNames.RecordCount
If intNames > 2 Then
MsgBox ("Blahhhhhhhhhhhh!")
Else
MsgBox ("Wooooooo!")
End If
End Sub
I imported all the objects from the 'test' db into the one I was having trouble in and when I try to open the same form that works in the 'test' db, i still get a 'Type mismatch' error.
Is anyone able to explain why this is happening?
Thank you