Forms :: How To Lock A Field In A Form
Sep 12, 2014
Is it possible to lock a field in a form after the user has populated the field? So for example, I have two date fields and I want them to be locked after the user has entered values on those fields. I want to avoid the user to come back in the future and change those fields. However I would like the database administrator to be able to change those dates when needed. How do I do this?
View Replies
ADVERTISEMENT
May 11, 2015
I have a data entry form that I would like to lock all fields until the Contract Number is entered.
to see if I was on the right path I tried something very simple,
on current
if me.contract_num = null then
msgbox("enter contract number")
end if
but that didn't even work
View 8 Replies
View Related
Jun 13, 2013
I would like to be able to lock a form's field temporarily until certain information has been added to other fields. Once the required fields are complete, I want to be able to allow the field to be updated.
Here is a simplified version of the table fields (only including relevant fields):
tblContacts
LastName (Text, Required field, Duplicates OK)
FirstName (Text, Required field, Duplicates OK)
CurrentEmployee (Yes/No field)
Basically, I don't want the user to be able to update the CurrentEmployee field in a new record until the LastName and FirstName fields have been completed.
The reason I want to prevent this is that when CurrentEmployee field is updated, the record is then assigned a ContactID number (PK autoID field) which means that my subform is assigned an ID# and the result is messy if the user decides to abort the creation of the record.
View 7 Replies
View Related
Jun 13, 2005
I need to lock and unlock a a few text fields with a CMd Button.
and i do know about the allowedits thing, but i only need to apply this to a few fields on my form.
can some one throw me a clue?
View 2 Replies
View Related
Oct 9, 2014
I'm still using Access 2003 to manage our membership database, is it possible to lock a field(member's name) if the membership is equal to withdrawal or terminated? Possible to use "on click"?
View 3 Replies
View Related
Oct 24, 2005
hi, i would like to be able to prevent a user from being able to change a field (lock a field) in a main form if a field in a subform is complete. (the field in the subform is named: "new_weekly_base" if this is complete then i would like the field: "weekly base" to be locked on the main form. is this possible?, please help.
the main form is named: "SCREEN-MAIN"
the subform is named: "SCREEN-SUBFORM"
(the main form has a button on it which loads the subform.)
ive tried the below code but it doesnt work, any help would be excellent.
-------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If [NEW_WEEKLY_BASE] >= 0 Then
With Me.WEEKLY_BASE
.Visible = True
.Enabled = False
End With
End If
End Sub
------------------------------------------------
View 4 Replies
View Related
Nov 28, 2013
I have a form in Access2000 with 5 text fields which get transferred to the table for each new record. Is there a way i can "LOCK" one field so that once the user has input that data it never changes until closed. I can already lock the field but once i create a new record the field then goes blank.
View 4 Replies
View Related
Aug 4, 2015
I'm trying to lock certain fields on my form based on the value in a particular field. It seems to work the first time but applies itself to all other records in the database from then on!
The starting point is a command button that sends an email and makes Me.DPLLock = 1. The corresponding table entry is formatted as a number.
The code is...
Private Sub Form_Current()
If Me.DPLLock = 1 Then
Me.OR_Name.Locked = True
Me.OR_Sales_Order.Locked = True
Me.OR_WO_No.Locked = True
Me.OR_Qty.Locked = True
[Code] ....
Ive tried Me!DPLLock with the same result.
View 7 Replies
View Related
Jul 7, 2014
I want to lock a form but keep it visible when a 2nd form opens in front of it. I would also like to keep the 2nd form on top. How to do these 2 things?
View 14 Replies
View Related
Mar 24, 2014
I have a form with several subforms within (tabbed subforms). I've used the code:
In the Current event of the parent form -
Code:
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False
In the Current event of each of the subforms -
Code: (THIS NEVER WORKS FOR ME - RUNTIME ERROR)
Me.AllowEdits = Me.Parent.AllowEdits
Me.AllowDeletions = Me.Parent.AllowDeletions
Me.AllowAdditions = Me.Parent.AllowAdditions
In the Click event of the button -
Code:
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True
So the main form is locked upon opening and unlocked with the click of an unlock button. How to apply this to the subforms as well. They just stayed unlocked the whole time.
View 14 Replies
View Related
Feb 15, 2014
I am trying to lock records on a form and subform after a checkbox has been ticked, have used the code below from a previous post.
Private Sub Form_Current()
If Locked = -1 Then
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False
[Code] .....
This is locking the Main form records is there a way to code this so that the fields on the subform are also locked when the checkbox is ticked?
View 7 Replies
View Related
Nov 24, 2005
Lock field for a record if another field is null:
I would like to stop users from entering a date in "Ctrl Closed" unless they have populated "Ctrl Reason" for any given record.
Not sure how to do this.
Any ideas would be greatly appreciated.
View 6 Replies
View Related
Apr 22, 2006
Hi,
I create the datasheet form,
I know how to lock the field, but it lock the whole column of the field.
I want to lock the field except the last record field only.
Can I do that?
eg.
ID Field1 Field2
1___a______b
2___c______d
3___z
I want to lock the field2 except the ID=3
Please let me know, thanks.
View 1 Replies
View Related
Aug 6, 2006
I've looked through the forum but haven't found quite what I want. I am a novice but realise this is going to be a relatively simple one ....
I use an invoice form for my own business with client details and a sub form with invoice lines. The client is selected via a combo box. I realise the danger that I could inadvertently alter the client, so would like to lock the client field when I move on to the next invoice or close the record, I don't want to lock the invoice lines. Can't get the code quite right and not sure whether this should be AfterUpdate or OnExit?
Any help much appreciated.
View 4 Replies
View Related
Aug 6, 2006
I'm doing a project for Tafe and I have some yes no questions on my form and a text box next to each one for detials if the answer was no for tick box I want the text box not to be able to write in ...
View 8 Replies
View Related
May 26, 2005
The question is in the title...
How do I allow people to enter data into a field once, but then lock it or disable it from being editted later.
Tried this:
Private Sub SubmittedD_Enter()
If SubmittedD = Null Then
SubmittedD.Locked = False
Else
SubmittedD.Locked = True
End If
End Sub
but the If statement isn't working... it just does the Else statement regardless of wether SubmittedD is null or not.
Thank you.
View 3 Replies
View Related
Jun 7, 2013
I have a field within a form that needs to be modified based off of someone's access level and I have written that part but not sure how to keep others from modifying the field.
Code:
Private Sub Qty_Rcvd_Click()
If ap_GetUserName() = "Danny_Davis" Or ap_GetUserName() = "christopher_ayers" Or ap_GetUserName() = "Tena_McCrackin" Then
GoTo 10
Else
MsgBox "You are not authorized to view this form"
End If
10
End Sub
Right now this code will bring up the msgbox for someone not authorized but once they hit "ok" the msgbox goes away and they can still change the field. What can I type in here to lock down the field for someone not authorized?
View 3 Replies
View Related
Jan 12, 2015
I have a check box on a form,that when ticked ,Iwant it to lock that check box (basically i dont want that info altered after this time) I know its something to do with the property but cant get it to lock the check box).
View 3 Replies
View Related
Jun 3, 2013
The company's register of projects we select the customer from a combo box that is related to the customer table. However, the way this works now, the individual may choose another customer by mistake, and if this is not corrected at the time the project will be listed with the wrong customer.
I would like to have a feature that when you select a customer receive a message if you are sure this is the right customer and if you answer yes then the customers name is being locked to this project ID.
View 5 Replies
View Related
Aug 24, 2006
I made a table containing information about products (price, amount, supplier,...). The most inportant info is the order number (cause it's unique).
Then I made a form, containing a combo-box and several text-boxes. The idea is to find a record using the combo-box, and vieuwing the information of that product in the form. This works, but a problem occurs: the order numbers change each time in a single number (I guess the autonumber). How can I solve this problem so that my combo-box is still available for searching, but no changes can be made in the table that is the source for the form?
View 2 Replies
View Related
Jun 23, 2015
I am having a problem running a make table query which is based on the same tables that I am using in a sub form.
Basically, the user selects certain records in the subform (which is in datasheet mode) using a check box, then once selected he hits a command button where there is some code that will run the make table query, which I use to filter other tables in a related reports.
However I keep getting this silly "database engine could not lock table" message relating to the sub form name. The subform is not linked to any records in the main form as the main form is unbound.
The solutions offered by putting DoEvents or Me.refresh/Me.requrey in the code do not work.
View 7 Replies
View Related
Dec 11, 2013
I developed a database for a group and i want to be able to prevent anyone from mucking things up.
View 4 Replies
View Related
Aug 29, 2013
I have several forms in my database that have a closed (1=Closed) option button. Is there a way to make all of the fields for that record readonly if the closed option is set to equal 1?
View 3 Replies
View Related
Jun 19, 2006
Hi,
I am trying to open my form locked and have the uers click a button to unlock the form to enter data. The way i do it now is have 2 forms one set to allow edits "yes" the other set to "no" and then have a button for each
This is working ok but i would like to tidy things up a bit and get it to one button.
I struggle with programming but i will do my best to understand any posts.
Thxs for any help
Adz
View 1 Replies
View Related
Aug 30, 2014
I got a problem about form designing. i need to disable my Close Command button while my subform Price cell is null and enable the Delete button.
And while delete button is pressed the delete action occurred and close button enabled.
View 12 Replies
View Related
Dec 24, 2013
I want to lock an individual record when a certain check box is ticked so it can't be edited again. I've tried setting the form to read only when this check box is ticked on the form OnCurrent event, but this locked every record and I had to remove the code to untick the check box and be able to edit the record again.
View 2 Replies
View Related