Darren Smith
Well-known Member
- Joined
- Nov 23, 2020
- Messages
- 631
- Office Version
- 2019
- Platform
- Windows
This code I have written in Access database I need to filter this table with a Combo box then add the result data to another Comb box in VBA excel
How is this possible?
How is this possible?
VBA Code:
Sub ExportData()
On Error GoTo ErrorHandler
Dim dbTable As String
Dim xlWorksheetPath As String
xlWorksheetPath = "\\TGS-SRV01\Share\ShopFloor\PRODUCTION\DLS Cardworker"
xlWorksheetPath = xlWorksheetPath & "Automated Cardworker.xlsm"
dbTable = "GantryHeight&Width"
DoCmd.TransferSpreadsheet transfertype:=acExport, spreadsheettype:=acSpreadsheetTypeExcel12, tablename:=dbTable, FileName:=xlWorksheetPath, hasfieldnames:=True
ErrorHandlerExit:
Exit Sub
ErrorHandler:
MsgBox "No Data Found”"
Resume ErrorHandlerExit
End Sub