sanders720
Programmer
Because my data is in a different access database? Is this possible?
Private Sub cmdGetData_Click()
Dim db As Database
Dim db_file As String
Dim sql As String
Dim rs As ADODB.Recordset
MsgBox Me.cboJobNo.Value
db_file = "v:\" & Me.cboJobNo.Value & ".mdb"
MsgBox db_file
Set db = OpenDatabase(db_file)
sql = "SELECT CAT, DESC1, DESC2, MFG, LOC FROM tblComp WHERE CAT <> isnull and LOC = " & Me.cboSubAssy.Value
Debug.Print sql
Set rs = db.OpenRecordset(sql)
Do While Not rs.EOF
' Syntax
Loop
rs.Close
Set rs = Nothing
Private Sub cmdGetData_Click()
Dim db As Database
Dim db_file As String
Dim sql As String
Dim rs As ADODB.Recordset
MsgBox Me.cboJobNo.Value
db_file = "v:\" & Me.cboJobNo.Value & ".mdb"
MsgBox db_file
Set db = OpenDatabase(db_file)
sql = "SELECT CAT, DESC1, DESC2, MFG, LOC FROM tblComp WHERE CAT <> isnull and LOC = " & Me.cboSubAssy.Value
Debug.Print sql
Set rs = db.OpenRecordset(sql)
Do While Not rs.EOF
' Syntax
Loop
rs.Close
Set rs = Nothing