crhodus
07-09-2001, 08:47 AM
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
D-Fresh
07-09-2001, 09:15 AM
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