By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Changing form properties with a button

P: n/a
Hello,

I currently have a subform that displays four fields from a query. I have
the subform's properties set as follows, so that the end users can not
accidently change the data.

Allow Edits = NO
Allow Deletions = NO
Data Entry = NO

I would like to have a 'EDIT' button that would change the form properties
to YES to allow intentional editing of the data, and then a 'Save' button
that would save the edited record and change the form properties back to NO.

Can somebody help with this?

Thanks!

Tim
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Put the following code in the Click event of the Edit button:
Me.AllowEdits = True
Me.AllowDeletions = True

Note - Data Entry hasnothing to do with whether you can edit or delete
records. When Data Entry is set to Yes, the form opens to a new record and
you can not navigate to existing records.

Put the following code in the Click event of the Save button:
DoCmd.RunCommand acCmdSaveRecord
Me.AllowEdits = False
Me.AllowDeletions = False
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Tim Graichen" <Tg*******@neo.rr.com> wrote in message
news:hr******************@fe1.columbus.rr.com...
Hello,

I currently have a subform that displays four fields from a query. I have
the subform's properties set as follows, so that the end users can not
accidently change the data.

Allow Edits = NO
Allow Deletions = NO
Data Entry = NO

I would like to have a 'EDIT' button that would change the form properties
to YES to allow intentional editing of the data, and then a 'Save' button
that would save the edited record and change the form properties back to NO.
Can somebody help with this?

Thanks!

Tim

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.