Darren Smith
Well-known Member
- Joined
- Nov 23, 2020
- Messages
- 631
- Office Version
- 2019
- Platform
- Windows
For some reason my
says Compile error User-defined type not defined. Does anybody know why it`s driving me mad
VBA Code:
Dim db as DataBase
says Compile error User-defined type not defined. Does anybody know why it`s driving me mad
VBA Code:
Private Sub Combobox_List()
Dim rsQry As Recordset
Dim Qry As String
Dim i As Long
Dim db As DataBase
Dim dbPath As String
Qry = "SELECT * FROM VehicleData"
dbPath = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\TGS-SRV01\Share\ShopFloor\PRODUCTION\DLS Cardworker\Access Files\DrNo Data Base.accdb;"
Set db = DBEngine.workspaces(0).OpenDatabase(dbPath)
Set rsQry = db.OpenRecordset(db, dbOpenSnapshot)
Model_Type.Clear
i = 0
While Not rsQry.EOF
'ModelType.AddItem
Me.Model_Type.List(i, 1) = rs.Fields("ModelType").Value
rs.MoveNext
i = i + 1
Wend
rs.Close
End Sub