Bilbo_Baggins_Esq
Registered User.
- Local time
- Yesterday, 19:49
- Joined
- Jul 5, 2007
- Messages
- 586
I know this is sitting right in front of me, but for some reason, it is eluding me...
Running Access 2010 x64 on Win7 x64
This fires a Run-time error '13': Type Mismatch error on the rs.Filter line.
In the database, "Trans_Cust_Num" is formatted as a number.
In the code, I've tried Customer_Number_VBA "As Double" and "As Long" and "As Integer" with no luck.
Anybody have any suggestions?
Running Access 2010 x64 on Win7 x64
Code:
Function Pull_Existing_Payments()
Dim ws As Workspace
Dim db As Database, rs As Recordset, rsFiltered As Recordset
Dim Customer_Number_VBA As Double
Dim Trans_Num_VBA As Double
Set ws = DBEngine.Workspaces(0)
Set db = ws.Databases(0)
Set rs = db.OpenRecordset("Transactions", dbOpenDynaset)
rs.Filter = "[Trans_Cust_Num]" = Customer_Number_VBA
Set rsFiltered = rs.OpenRecordset
rsfiltered.MoveFirst
Trans_Num_VBA = rsfiltered!Trans_Num
MsgBox Trans_Num_VBA
rs.Close
End Function
This fires a Run-time error '13': Type Mismatch error on the rs.Filter line.
In the database, "Trans_Cust_Num" is formatted as a number.
In the code, I've tried Customer_Number_VBA "As Double" and "As Long" and "As Integer" with no luck.
Anybody have any suggestions?