How To Change Form RecordSet

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?
 
S

scubadiver

In the 'onclick' event of the option box I would probably try something like

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

Duck

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
 
D

Duck

you want to be using RecordSOURCE not recordSET






- Show quoted text -

Using RecordSource instead of RecordSet solved the problem...Thank you
all very much
 

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

Top