CheckBox

K

KarenMike

Does anyone know how to write code so that if a box is checked, it will pull
information from another table?
 
O

Ofer Cohen

Not sure if that what you are asking for, if it's not please explain more of
what you are trying to do.

To change the record soure of the form, depend on the check box

If Nz(Me.[CheckBox],False) = True Then
Me.ControlSource = "Select * From TableName"
Else
Me.ControlSource = "Select * From TableName2"
End If
Me.Requery
 
K

KarenMike

Let me see if I can explain it better. A current form is tied to three
tables. Table one is member table with demographical information. Table two
is a reciepient table with demographical information. And table three is
receipt information. My goal is to somehow state that if a box is checked use
member demographics, and if unchecked use recipient information.
--
Karen K


Ofer Cohen said:
Not sure if that what you are asking for, if it's not please explain more of
what you are trying to do.

To change the record soure of the form, depend on the check box

If Nz(Me.[CheckBox],False) = True Then
Me.ControlSource = "Select * From TableName"
Else
Me.ControlSource = "Select * From TableName2"
End If
Me.Requery


--
Good Luck
BS"D


KarenMike said:
Does anyone know how to write code so that if a box is checked, it will pull
information from another table?
 
O

Ofer Cohen

I had a small mistake, I used ControlSource instead of Record Source

On the AfterUpdate event of the check box try something like, you can create
a text box in the form to state which table you are using

If Nz(Me.[CheckBox],False) = True Then
Me.RecordSource= "Select * From member"
Me.[TextBoxName] = "member"
Else
Me.RecordSource = "Select * From recipient"
Me.[TextBoxName] = "recipient"
End If
Me.Requery


--
Good Luck
BS"D


KarenMike said:
Let me see if I can explain it better. A current form is tied to three
tables. Table one is member table with demographical information. Table two
is a reciepient table with demographical information. And table three is
receipt information. My goal is to somehow state that if a box is checked use
member demographics, and if unchecked use recipient information.
--
Karen K


Ofer Cohen said:
Not sure if that what you are asking for, if it's not please explain more of
what you are trying to do.

To change the record soure of the form, depend on the check box

If Nz(Me.[CheckBox],False) = True Then
Me.ControlSource = "Select * From TableName"
Else
Me.ControlSource = "Select * From TableName2"
End If
Me.Requery


--
Good Luck
BS"D


KarenMike said:
Does anyone know how to write code so that if a box is checked, it will pull
information from another table?
 
Top