Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, How do you put a variable in an SQL statement in Excel?
There's a form where the user selects project number from a combo box. I want to take the project number the user selected and use in the SQL below. I keep getting either syntax errors or Expected: named parameter. Please help! cboProjectNumberID = intDSRProjectNumber adoRecordset.Open _ Source:="SELECT tblDSREquipment.DSREquipmentID, tblDSREquipment.BWProjectNumberID, tblDSREquipment.VendID, tblDSREquipment.COAID, tblDSREquipment.EquipmentShipDate, tblDSREquipment.POReleaseDate, tblDSREquipment.DSRCreateDate, tblDSREquipment.DSRDocumentNumber, tblDSREquipment.DSRDocumentRevision, tblDSREquipment.SystemPartPolicy, tblDSREquipment.ReleaseIndicator, tblDSREquipment.EText, tblDSREquipment.LifecycleState, tblDSREquipment.UOM, tblDSREquipment.PartBLSCreated, tblProjectData.BWProjectNumber, tblProjectData.BWProjectName " & _ "FROM tblDSREquipment INNER JOIN tblProjectData ON tblDSREquipment.BWProjectNumberID = tblProjectData.BWProjectNumberID " & _ "WHERE (((tblDSREquipment.BWProjectNumberID)= (' & intDSRProjectNumber & '))", |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assigning a Variable to an Expression that Includes a Variable andVBA Property | Excel Programming | |||
Nothing Keyword Destories Objects rather than just resetting the variable to an empty variable | Excel Programming | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |