Locking the form when entering is finished

Pusher

BEOGRAD Put
Local time
Today, 11:38
Joined
May 25, 2011
Messages
230
Hi all,

How to lock my form so I can’t change the interventions I locked. I want to be able to enter a number of interventions in a form for different dates (go true them if I need to) and than LOCK them when I want to so it can't be changed and I can than only enter new interventions.


How to lock my form so I can’t change the interventions I locked.
Thanks :)
 
Set the Allow Edits property of your form to No.
 
The nature of entering this form is in a span of a few hours because its real time interventions in the field. When they are finished and all the info is entered (finished) and then it needs to be locked. This works only if you have all the info right away and can go to the next record/intervention. We have more interventions at one time that will be entered at different times during the day.
 
Set the property when all the info has been entered.
 
[FONT=&quot]where do I do that? Can I make a button to indicate the completion of the form?[/FONT]
 
I think you are coming up with your own solutions which is good. So make a button and get confirmation via a MsgBox. Once they click Yes lock it.

Or if you have a Save button you can put it there too but make sure you get confirmation before proceeding.
 
That would be a good solution, do you know were i can get to learn how to do that or some other help :)
 
The Save button, witch will write the record in the table that can't be changed, but that i can go true the records (changing them if i must) that i have not saved.
 
This is chained to a lot of things.

* Do you have a custom navigation bar? Or are you using the built-in navigation bar?
* Is the form in Continuous View, Single Form or Datasheet?
 
I don't think so :( and i think its single form...
Here is my db so you can look, the form is IZVESTAJ
 

Attachments

Here's a routine for using a CheckBox to 'lock' a Record:

Create a Checkbox, name it LockRecord, and set it’s Tag Property to "skip" (without the quotes). Then, in its AfterUpdate event:

Code:
Private Sub LockRecord_AfterUpdate()
Dim ctrl As Control

If Me.LockRecord = -1 Then

For Each ctrl In Me.Controls
    If (TypeOf ctrl Is TextBox) Or (TypeOf ctrl Is CheckBox) Then
     ctrl.Locked = True
    End If
 Next

Else

For Each ctrl In Me.Controls
    If (TypeOf ctrl Is TextBox) Or (TypeOf ctrl Is CheckBox) Then
      ctrl.Locked = False
    End If
 Next
 
End If
End Sub
Also place this same code in the Form_Current event.

The code can easily be modified to include other types of Controls in the 'locking' procedure.

Linq ;0)>
 
Thanks this works great, but can I limit the entry to one date only. So I can lock only for the last day I enter and I cant change the day before(every thing else is already locked), i don't even need to see the lines from the day before.
 
It’s actually that the form can go true just the lines that are new from the time you started entering the form. When you lock it the time is reset so you can only then enter new lines and edit them until you lock it again.
 
How can I make so I can only go true the current date in my form and I can’t go to the lines that are older. Also is there a way that I maybe limit my view of lines by value of one of the fields in my other (login) form.
 
I have created a check box that I want to use that if checked it locks only a certain field. I enter vehicle vin numbers and want to avoid accidental deletion but want to allow for quick editing and need the ability to add new records. Can you help me with the code?
 
I have created a check box that I want to use that if checked it locks only a certain field. I enter vehicle vin numbers and want to avoid accidental deletion but want to allow for quick editing and need the ability to add new records. Can you help me with the code?
Please post your question in a new thread.
 

Users who are viewing this thread

Back
Top Bottom