0
votes

I have been struggling with this NUMBER(listed in Table) syntax this morning - I have a form with a combo box [cboIndicator] that looks up the value [Severity Indicator] from a table called tbl_ASPACSplitInventorySelect. Right now Severity Indicators 1-5 are correct, but the NULL value in the combobox box are spitting out an 3075 error.

Private Sub cboIndicator_AfterUpdate()
Dim myIndicator As String
myIndicator = "Select * from tbl_ASPACSplitInventorySelect where ([Severity Indicator] = '" & Me.cboIndicator
Me.ASPACSplitInventorySelect_subform1.Form.RecordSource = myIndicator
Me.ASPACSplitInventorySelect_subform1.Requery
Me.cboGrouping = Null
Me.Combo830 = Null
End Sub

I'm receiving a run-time error 3075 syntax error. As you can tell there is a subform listed and double checked all source objects. Any help would be greatly appreciated. Line Four appears to be the highlighted for data mismatch.

1
Can you tag this with the appropriate programming language? Think about it...how could anyone answer this without that information? - rory.ap
Thank roryap, didn't even notice the sql tag was missing - K.D.
It's not sql. It looks more like VB. But you can't assume that people know that. And what flavor of vb? VB.NET? VBA? - rory.ap
Also, you need to tell us more information: for example, what line is the error occurring on? - rory.ap
In the where clause, are you comparing two same data types? - sagi

1 Answers

0
votes

in the statement

myIndicator = "Select * from tbl_ASPACSplitInventorySelect where ([Severity Indicator] = '" & Me.cboIndicator

a quote and a ')' are missing.

If the table field Severity Indicator is defined as TEXT:

myIndicator = "Select * from tbl_ASPACSplitInventorySelect where ([Severity Indicator] = '" & cstr(Me.cboIndicator) & "');"

If the table field Severity Indicator is defined as NUMBER:

myIndicator = "Select * from tbl_ASPACSplitInventorySelect where ([Severity Indicator] = " & cstr(Me.cboIndicator) & ");"

Please note that before this statement it would be useful to check the value of Me.cboIndicator, with something like:

If not isnull(Me.cboIndicator) and not isempty(Me.cboIndicator) then ...