option value question

  • Thread starter Thread starter LJG
  • Start date Start date
L

LJG

Hi Guys,

Got an option box to filter a forms data, I have added a text box that the
query picks up the value. It works fine for option "1" and "3" but for
option2 it needs to be 1 Or 2 for the query to work correctly.

Can anyone suggest an alternative

Thanks
Les

Code Below:

Private Sub optAccountType_AfterUpdate()
If optAccountType = 1 Then
Me.txtstatus = "1"
Me.frmListing01.Requery
Else
If optAccountType = 2 Then
Me.txtstatus = "1 Or 2"
Me.frmListing01.Requery
Else
If optAccountType = 3 Then
Me.txtstatus = "3"
Me.frmListing01.Requery
End If
End If
End If
End Sub
 
OR is an operator, not a value. You can't put it in the box, and expect
Access to treat it as an operator.

You could change the Filter of the form, or reassign its RecordSource (or
RowSource is this is a list box.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top