Enquiry on Checkbox

lilywong

New member
Local time
Today, 06:18
Joined
Jun 12, 2008
Messages
6
i have a search database created in access.

i want to have a checkbox, so when i tick the checkbox (checkbox is checked), it can log the database so no one can change the database after the checkbox is checked.

if the checkbox is uncheck, then we can update the record.

any idea?

thanks.
 

Attachments

is the databound to your form? if so, i think you can just change the "allow addition" ,"allow deletions", and "allow edits" properies. if the form is not databound, and your manually changing the table with sql statements, just put an if..then..else statement to check the state of the box and enable/disable sending the sql statement
 
If Status = "Y" Then
CDNo.Locked = True
Else
CDNo.Locked = False
End If

i try this but it is not working. both record also can be updated regardless of Y or N.
what i want is, if status = "Y" --> allow update record
if status = "N" --> not allow update record


thanks.
 
Last edited:
check to make sure your if then statement is working correctly (you can do this by putting in a msgbox or debug line). usually the values of a check box (by default anyway) are -1 and 0. how are you sending the insert to the table (is the form bound or are you using docmd.runsql with a sql statement?)

if using the docmd, then just put it in the if...then statement otherwise enable/disable the send button.
 

Users who are viewing this thread

Back
Top Bottom