I've used Access before with VB, but it's been awhile. I have this code...
Option Explicit
Private Const gstrPNDB As String = "C:\TestPartNumbers.mdb"
Private Sub cmdProcess_Click()
Dim strSQL As String
Dim strPartNum As String
Dim strDate As String
Dim strInitials As String
Dim dbPartNum As Database
Dim rsNew As Recordset
strSQL = "SELECT * FROM Production WHERE CheckedOut = True ORDER BY PartNumber"
Set dbPartNum = OpenDatabase(gstrPNDB, True)
Set rsNew = dbPartNum.OpenRecordset(strSQL)
...
on the last line, the Set rsNew... I am getting a runtime error 13: type mismatch. Any idea why? I'm sure this should work. CheckedOut in strSQL is a Yes/No field in the access table. Oh, and I do have the correct references included in my project.
Option Explicit
Private Const gstrPNDB As String = "C:\TestPartNumbers.mdb"
Private Sub cmdProcess_Click()
Dim strSQL As String
Dim strPartNum As String
Dim strDate As String
Dim strInitials As String
Dim dbPartNum As Database
Dim rsNew As Recordset
strSQL = "SELECT * FROM Production WHERE CheckedOut = True ORDER BY PartNumber"
Set dbPartNum = OpenDatabase(gstrPNDB, True)
Set rsNew = dbPartNum.OpenRecordset(strSQL)
...
on the last line, the Set rsNew... I am getting a runtime error 13: type mismatch. Any idea why? I'm sure this should work. CheckedOut in strSQL is a Yes/No field in the access table. Oh, and I do have the correct references included in my project.