CheckBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to write code so that if a box is checked, it will pull
information from another table?
 
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
 
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?
 
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?
 

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