I am just trying to get some data from an external Access db but keep getting a type mismatch. Can my code eventually do it or am I barking up the wrong tree?
Sub MyLook()
Dim myval As Long
Dim dbs As Database
Dim rst As New Recordset
Dim lngeto As Long
lngeto = 2 'Will be in a drop down box
Set dbs = OpenDatabase("P:\Toolroom\ToolRoom.mdb")
Set rst = dbs.OpenRecordset("SELECT Department " _
& " FROM tblorders " _
& " WHERE [ETO Number]=" & lngeto & ";")
MsgBox rst 'Test to see if it works
End Sub
Thanks
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm afraid knot.
Sub MyLook()
Dim myval As Long
Dim dbs As Database
Dim rst As New Recordset
Dim lngeto As Long
lngeto = 2 'Will be in a drop down box
Set dbs = OpenDatabase("P:\Toolroom\ToolRoom.mdb")
Set rst = dbs.OpenRecordset("SELECT Department " _
& " FROM tblorders " _
& " WHERE [ETO Number]=" & lngeto & ";")
MsgBox rst 'Test to see if it works
End Sub
Thanks
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm afraid knot.