Disable command button on read only form

  • Thread starter JACKGUNAWAN via AccessMonster.com
  • Start date
J

JACKGUNAWAN via AccessMonster.com

Hi,

I have a form that is opened in Read Only to allow the user to view history
data so it cannot be changed. I am using the same form that allows the user
to enter data when opened normally. Instead of creating a whole seperate
form, I need to disable delete record buttons so they cannot click
on it and delete some data purposely.

Any suggestions/solutions would be
greatly appreciated.

I was thinking 1. how can I disable the delete button on read only forms?
and 2. how can I disable automatically the delete button on the Editable
open form after a new form is created?

I am inexperienced about coding or modules. Thank you.


Jack
 
L

Linq Adams via AccessMonster.com

"Instead of creating a whole seperate form"

Creating a "whole separate form" would take about two minutes, tops!

You right click on the form name, copy the form, right click and paste it.
Then open new new form in Design View and change the properties to Disable
the command buttons or simply select them and delete them..
 
J

JACKGUNAWAN via AccessMonster.com

Hi Adam,

Thanks for the solution. I have not thought about it. How bout no 2. how can
I disable the delete button on the Editable current open form everytime a new
form is created? Any suggestion or solution? Thanks again.


Jack
 
B

BruceM via AccessMonster.com

Every time a new form is created? Maybe you meant when a new record is
created? If so, you could have something like this in the form's Current
event:

Me.cmdDelete.Visible = Not Me.NewRecord

You could use Enabled instead of Visible. I tend to hide rather than disable
controls that are not to be used in a certain situation.

If you show how you are opening the form as editable or not it will probably
be possible to show how to use OpenArgs to hide/unhide (or enable/disable)
the command button.
 
J

JACKGUNAWAN via AccessMonster.com

Hi Bruce,

Yes I mean a new record form which create a new order id. Since I am
inexperienced about programming, where is the form current event? Thanks.



Jack
 
J

JACKGUNAWAN via AccessMonster.com

Hi Bruce,
Yes I mean a new record form which create a new order id. Since I am
inexperienced about programming, where is the form current event?

I tried placing it in the "on current" item event procedure in the form's
design view but my subform cannot be edited.


Thanks.
 
B

BruceM via AccessMonster.com

Is it something new that the subform cannot be edited? Do you mean you
cannot add/shange/delete records? What is the code you placed in the Current
event, and how did you place it there? Is the command button you want to
hide/disable on the subform or on the main form?
 
J

JACKGUNAWAN via AccessMonster.com

Hi Bruce:

Yes, I intend that other users cannot change/add/delete the records or form
items on the previous forms. Currently every time current new form is created,
the previous forms can be viewed and editted. So that they can only edit or
add new records on new forms. I place the code you provided in the main form.
the command button is on the main form. Please guide me step by step on
placing the code. Thanks.


Jack
 

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

Top