How To Change Form RecordSet

  • Thread starter Thread starter Duck
  • Start date Start date
D

Duck

I have a form that is used to display patient records. It's default
Recordset is set to a query which shows only current clients. I want
to use an option box on the form to force the form to use the client
table (tblClients) as it's source Recordset, which would display ALL
clients (past and present), not just current clients. How do I
accomplish this?
 
In the 'onclick' event of the option box I would probably try something like

if me.checkbox.value = -1 then me.Form.Recordset = "tblclients"
 
In the 'onclick' event of the option box I would probably try something like

if me.checkbox.value = -1 then me.Form.Recordset = "tblclients"





- Show quoted text -

I tried that already and would get "Operation is not supported for
this type of object" error My code is:

If Me.optAllOrCurrent.Value = 1 Then
Me.Form.Recordset = "qryCurrentClients"
Else
Me.Form.Recordset = "qryCurrentClientsAll"
End If

The optionbox can have a value of either 1 (default) or 2
 
Back
Top