Same form for readonly/allow edits

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Wasn't quite sure how to search this topic.

My (1st) db is about to be distributed to multi-users. I would like to make
all my forms read-only and add an "Edit" button on each users can't
accidentally overwrite existing records. Also lock older records as per
another post I read today.

Am hoping to open forms read-only from the Switchboard buttons. But the
default buttons seem to only allow Data Entry or edit. If possible I want to
keep the built-in Switchboard because our network is very slow so we want the
switchboard table on each user's pc. (they have to close all forms but can
keep the Switchboard running and not have to re-login every time they need
it)

Does anybody know how I can change the Switchboard button code to open
read-only but still allow a new "edit" button to open again AllowEdits.

And will the "edit" button cause problems? For example, do I have to close
the form & re-open, etc. in the code, or what would be the smartest way to do
this and revert back to read-only on "save"?

Any help is much appreciated!!
 
Hi Lungta

You can switch the entire form between read-only and editable using the
AllowEdits property:

Me.AllowEdits = True makes the form editable

Me.AllowEdits = False makes it read-only

You could have the code in the Form_Load event procedure set AllowEdits to
False, and then have the click event of your "Edit" button set it to True.
 
Set the AllowEdits, AllowDeletions and AllowAdditions properties of your
forms to False. In the Edit button's Click event, set those properties to
True.
 
Thanks to both of you for your help - I tried both your suggestions and they
work great! I'm just stuck on one thing.

The Save button is where I put the code to revert back to
Me.AllowEdits=False, Me.AllowAdditions=False, etc. But if a user simply
moves to another record, the "allow edits" stays live.

Is there a better spot for putting this code, or a way to reset it somehow
on Current record?

Thanks,
 
Try putting the

me.allowEdits=False

in the oncurrent Event.

This will make the default as no edits.

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top