The Form has properties that control what actions can be taken... if the
Property Sheet is not visible in Design View, the click the upperleftmost
little box, right-click, and choose Properties. On the Property Sheet, click
the Data tab. You'll see properties for Allow Edits, Allow Deletions, and
Allow Additions. Set all those to No, and the Form can only be used to View.
To allow the same Form to be used for Editing existing data, you can add a
Command Button and put the code
Me.AllowEdits = True
in the Click Event of the Command Button.
To allow it to be used to add records, add a Command Button with
Me.AllowAdditio ns = True
Those settings will revert to their original setting when you close the
Form; but if you want to leave the Form open and revert, then you'll need to
put
Me.AllowEdits = False
Me.AllowAdditio ns = False
in the Form's AfterUpdate event.
Or, you can use other code if you want to open the form in Edit or Add
mode... check help on DoCmd.OpenForm.
Larry Linson
Microsoft Access MVP
"Oxy" <ce******@gmail .comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Hi all,
I have a pre-defined table with several fields. I'm trying to create a
form that'll have a drop down list showing several records (e.g.names
from the table) and several check boxes that'll indicate status (e.g. a
checked box could mean married/single, >40 or <40 etc.). I'd like to
write data to this table - for example if I check or uncheck a box, a
"YES" or "NO" should be written to that particular field in the table.
I'd also like to know if I can use this form in a "view" mode where the
user cannot edit data and in a separate "edit" mode to write data to
the table. I'm very new to access database programming but will catch
up with some basic tips. I tried to search the group but could not find
anything related to check boxes. My apologies if this question has been
previously posted (please point me to it!). Really appreciate any help.
Thanks.