I created a form with a dbcombo3, and two text boxes textoperator and textoperatorVar and data7
with Data 7 properties:
select [Operator],[OperatorID],[OperatorVar] from Staff order by [Operator]
I need to check the condition of the field [operatorvar] to return a message depending on the condition
No problem to populate the first two fields with data7 from field [Operator] and boundcolumn[operatorid]
My problems is to find the coresponding data for the field [operatorvar]
Code when click on operator in drop down list of DBCombo3
Private Sub DBCombo3_Click(Area As Integer)
Dim sqlstring
sqlstring = "select [Operator],[OperatorID],[OperatorVar] from Staff where [OperatorID] = " & DBCombo3.BoundText
Data7.RecordSource = sqlstring
Data7.Refresh 'THIS RETURNS ERROR MESSAGE RUNTIME ERROR 3061 Too few parameters. Expected 1
Text3.Text = DBCombo3.BoundText
MsgBox DBCombo3.BoundText' IF RUN THE MESSAGE BOX RETURNS THE CORRECT OPERATOR ID AS IN DBCombo3.BoundText
Text5.Text = Data7.Recordset("OperatorVar"
'BUT THIS RETURNS THE VALUE OF THE 1ST RECORD FROM THE TABLE AND NOT THE RECORD FOR THE VALUE IN DBCombo3.BoundText
End Sub
with Data 7 properties:
select [Operator],[OperatorID],[OperatorVar] from Staff order by [Operator]
I need to check the condition of the field [operatorvar] to return a message depending on the condition
No problem to populate the first two fields with data7 from field [Operator] and boundcolumn[operatorid]
My problems is to find the coresponding data for the field [operatorvar]
Code when click on operator in drop down list of DBCombo3
Private Sub DBCombo3_Click(Area As Integer)
Dim sqlstring
sqlstring = "select [Operator],[OperatorID],[OperatorVar] from Staff where [OperatorID] = " & DBCombo3.BoundText
Data7.RecordSource = sqlstring
Data7.Refresh 'THIS RETURNS ERROR MESSAGE RUNTIME ERROR 3061 Too few parameters. Expected 1
Text3.Text = DBCombo3.BoundText
MsgBox DBCombo3.BoundText' IF RUN THE MESSAGE BOX RETURNS THE CORRECT OPERATOR ID AS IN DBCombo3.BoundText
Text5.Text = Data7.Recordset("OperatorVar"
End Sub