Command Button to Unlock and Lock Fields/Edit Button? (1 Viewer)

ejoburke90

New member
Local time
Yesterday, 21:01
Joined
Feb 19, 2014
Messages
5
Hi everyone,

So I have essentially taught myself how to use Access, which I'm sure means that I haven't learned some basics that would really help me with what I am trying to figure out. However...this is my current problem.

I have created a web-database (? - There are globes over all the forms and tables icons) based on the Issues & Tasks template. This means that most of the data is entered and seen on the "Main" form, which has two tabs - Open Issues and Closed Issues. I have created a form that allows people at my work to input the necessary data and save it, so that it will show up on one of the two tabs. However, once a record has been created, I want to be initially locked if the ID/PK is clicked, so that data can't be changed or entered inadvertently. SO, I changed the code so that when the ID/PK for a record is clicked, it brings up a different form, but one that looks exactly like the one that is brought up when entering a new form, but I locked all of the fields so that the information cannot be changed. It seems from what I have read that I can create a button on this form so that when clicked, it unlocks the fields on the form so that they can be changed, and then when clicked again it will lock the fields again. Is this true? If so, how can I do it? Or is there something similar I can do? I have seen codes that I could copy and paste, but I cannot figure out the place to copy and paste codes in Access 2010.

I have changed the Form properties so that Data Entry and all the "Allows" are set to No...

Any help would be immensely appreciated.
 

ejoburke90

New member
Local time
Yesterday, 21:01
Joined
Feb 19, 2014
Messages
5
Thank you, but unfortunately that does not help me much. The version of Access I have does not allow me to copy and paste codes, nor does any kind of Wizard start, so I am not really capable of putting that into my form, unless someone can explain where I can copy and paste code on Access 2010. Essentially, when I am in Layout View (Design View is not an option), I click on the button I have created, and in the Properties click Event. There is only item under Event, which is On Click. That says [Embedded Macro] and there is a small box with "..." in it. I click on that and takes me to where I can input a macro or code, but I can only choose from drop down boxes to create. So from that point I am stuck because I have no idea where to even start to create a similar code such as the one in your post. :/
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 05:01
Joined
Jul 9, 2003
Messages
16,271
a small box with "..." this "..." is called ellipsis
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 05:01
Joined
Jul 9, 2003
Messages
16,271
>>>There is only item under Event, which is On Click. That says [Embedded Macro]<<<

I'm not on a machine with MS Access right now so I can't test this...

But try deleting the text [Embedded Macro] and then press the ellipsis. (...)
 

ejoburke90

New member
Local time
Yesterday, 21:01
Joined
Feb 19, 2014
Messages
5
>>>There is only item under Event, which is On Click. That says [Embedded Macro]<<<

I'm not on a machine with MS Access right now so I can't test this...

But try deleting the text [Embedded Macro] and then press the ellipsis. (...)


I tried...it brought me to the same screen as before, where the macro/code can only be entered by using drop-down boxes and other inputs.
 

ejoburke90

New member
Local time
Yesterday, 21:01
Joined
Feb 19, 2014
Messages
5
This is what I expected to happen:-

Ohh - I WISH that is what happened when I clicked the ellipses, but I do not get a choice of Code Builder. It simply takes me right to Macro Builder, I believe.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 05:01
Joined
Jul 9, 2003
Messages
16,271
I should post a separate question, see if there is a setting you can change.
 

Users who are viewing this thread

Top Bottom