S
SteveP
I have a table named "Inventory06" with columns ID, Item, and Description.
On my form, I have two comboboxes - cboItem and cboDescription - that I am
wanting to have pull the corresponding info from the Item and Description
columns. I have the cboItem combo pulling correctly. However, when I click
on cboDescription, it gives me a "Syntax error in FROM clause" error. Below
is the code I have and where it is. Any help is greatly appreciated.
cboItem combo:
RowSource: SELECT Inventory06.ID,Inventory06.Item FROM Inventory06;
AfterUpdate:
Private Sub cboItem_AfterUpdate()
Dim sDescription As String
sDescription = "SELECT
[Inventory06].[ID],[Inventory06].[Item],[Inventory06].[Description]" & _
"FROM Inventory06" & _
"WHERE [ID]=" & Me.cboItem.Value
Me.cboDescription.RowSource = sDescription
Me.cboDescription.Requery
End Sub
cboDescription:
RowSource: SELECT Inventory06.ID, Inventory06.Item, Inventory06.Description
FROM Inventory06;
On my form, I have two comboboxes - cboItem and cboDescription - that I am
wanting to have pull the corresponding info from the Item and Description
columns. I have the cboItem combo pulling correctly. However, when I click
on cboDescription, it gives me a "Syntax error in FROM clause" error. Below
is the code I have and where it is. Any help is greatly appreciated.
cboItem combo:
RowSource: SELECT Inventory06.ID,Inventory06.Item FROM Inventory06;
AfterUpdate:
Private Sub cboItem_AfterUpdate()
Dim sDescription As String
sDescription = "SELECT
[Inventory06].[ID],[Inventory06].[Item],[Inventory06].[Description]" & _
"FROM Inventory06" & _
"WHERE [ID]=" & Me.cboItem.Value
Me.cboDescription.RowSource = sDescription
Me.cboDescription.Requery
End Sub
cboDescription:
RowSource: SELECT Inventory06.ID, Inventory06.Item, Inventory06.Description
FROM Inventory06;