A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

locking off a form



 
 
Thread Tools Display Modes
  #1  
Old January 13th, 2010, 11:05 AM posted to microsoft.public.access.forms
Kazlou
external usenet poster
 
Posts: 24
Default locking off a form

I have a section in a database for the evaluation of a supplier that is
completed by the appropriate manager. How do I give them the ability to
complete the form, save it, go back to it and make adjustments, then when
finally happy confirm it and lock the form from any further changes?

thanks
karen


  #2  
Old January 13th, 2010, 11:44 AM posted to microsoft.public.access.forms
Keith Wilby
external usenet poster
 
Posts: 812
Default locking off a form

"Kazlou" wrote in message
...
I have a section in a database for the evaluation of a supplier that is
completed by the appropriate manager. How do I give them the ability to
complete the form, save it, go back to it and make adjustments, then when
finally happy confirm it and lock the form from any further changes?

thanks
karen



Put a Boolean field into your table and name it "ReadOnly". Put a hidden
check box called "chkReadOnly" on your form and bind it to your Boolean
field. Put a "commit" command button called "cmdSubmit" on your form and
put this code in its click event:

If MsgBox("You won't be able to edit your responses once they are
committed - continue?", vbYesNo, "Confirm commit") = vbYes Then
Me.chkReadOnly = -1
Me.Refresh
Call Form_Current
End If

Then in your form's Current event:

If Me.chkReadOnly Then
Me.AllowEdits = False
Me.cmdSubmit.Enabled = False
Else
Me.AllowEdits = True
Me.cmdSubmit.Enabled = True
End If

That should do it, although you might want to add some code to check that
the user has fully completed the task before submission.

Keith.
www.keithwilby.co.uk

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.