Multiple Control Sources for One Check Box

crhodus

Registered User.
Local time
Today, 04:12
Joined
Mar 16, 2001
Messages
257
I have a check box on one of my forms call INDIVIDUAL. This field is in two other tables. Can this check box be referenced, so that if the user checks or unchecks the box, the value will be passed and saved to all three field in each table? Hope this makes sense.

Tanks
 
Set up an Update SQL statement on the click event of your checkbox...

dim MyDB as database
dim MySQL as string

set MyDB = currentdb
MySQL = "UPDATE [TableName] Set [TableCheckBoxName]="

if me![CheckBoxName] then
MySQL = MySQL & "True"
Else
MySQL = MySQL & "False"
End If

'If there is a where clause here then you have to add that to the SQL Statement. Like...
'MySQL = MySQL & " WHERE [Record_No]=" & me![Record_No]

'Otherwise leave the above line out.... The line below will execute the statement...

MyDB.Execute(MySQL)

Where TableName is the name of the table to be updated and TableCheckBoxName is the checkbox field of the table. Make sure to test this first or at least make backups of your tables. If this is your first time playing around with the Update SQL Statement, you might possibly mess up the data in your table. Hope that helps.

Doug
 

Users who are viewing this thread

Back
Top Bottom