Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

CheckBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KarenMike - 14 May 2007 20:24 GMT
Does anyone know how to write code so that if a box is checked, it will pull
information from another table?
Signature

Karen K

Ofer Cohen - 14 May 2007 21:57 GMT
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

Signature

Good Luck
BS"D

> Does anyone know how to write code so that if a box is checked, it will pull
> information from another table?
KarenMike - 15 May 2007 13:19 GMT
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.
Signature

Karen K

> Not sure if that what you are asking for, if it's not please explain more of
> what you are trying to do.
[quoted text clipped - 10 lines]
> > Does anyone know how to write code so that if a box is checked, it will pull
> > information from another table?
Ofer Cohen - 15 May 2007 19:08 GMT
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

Signature

Good Luck
BS"D

> 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
[quoted text clipped - 16 lines]
> > > Does anyone know how to write code so that if a box is checked, it will pull
> > > information from another table?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.