J jimjaix Registered User. Local time Yesterday, 20:43 Joined Dec 12, 2007 Messages 20 Apr 13, 2009 #1 Hi, I have a form for user to input data. And also have a field called "Complete?" I want create some vba code that will lock that record IF the field Complete? is a Yes. And then give a message.
Hi, I have a form for user to input data. And also have a field called "Complete?" I want create some vba code that will lock that record IF the field Complete? is a Yes. And then give a message.
pbaldy Wino Moderator Staff member Local time Yesterday, 17:43 Joined Aug 30, 2003 Messages 36,272 Apr 13, 2009 #2 Use the current event of the form, test the value of that field with an If/Then/Else, and set AllowEdits to True or False appropriately.
Use the current event of the form, test the value of that field with an If/Then/Else, and set AllowEdits to True or False appropriately.
J jimjaix Registered User. Local time Yesterday, 20:43 Joined Dec 12, 2007 Messages 20 Apr 13, 2009 #3 Can you give me an example? I am new to access and not sure how things work.
pbaldy Wino Moderator Staff member Local time Yesterday, 17:43 Joined Aug 30, 2003 Messages 36,272 Apr 13, 2009 #4 http://www.access-programmers.co.uk/forums/showthread.php?t=163908
J jimjaix Registered User. Local time Yesterday, 20:43 Joined Dec 12, 2007 Messages 20 Apr 13, 2009 #5 Hi I use the following code and I am getting "Compile error: Method or data member not found" pointing to Private Sub Form_Current() Code: Private Sub Form_Current() If Me.Completed = "Yes" Then Me.AllowEdits = False Else Me.AllowEdits = True End If End Sub pbaldy said: http://www.access-programmers.co.uk/forums/showthread.php?t=163908 Click to expand...
Hi I use the following code and I am getting "Compile error: Method or data member not found" pointing to Private Sub Form_Current() Code: Private Sub Form_Current() If Me.Completed = "Yes" Then Me.AllowEdits = False Else Me.AllowEdits = True End If End Sub pbaldy said: http://www.access-programmers.co.uk/forums/showthread.php?t=163908 Click to expand...
J jimjaix Registered User. Local time Yesterday, 20:43 Joined Dec 12, 2007 Messages 20 Apr 13, 2009 #6 Disregard my previous message, the name didn't match. Changed the name and it works
J jimjaix Registered User. Local time Yesterday, 20:43 Joined Dec 12, 2007 Messages 20 Apr 13, 2009 #7 Hi, I am using the following code where Completed is a YES/NO, I want to change the following code to Yes/No instead IsNull. How do I do that? Code: If IsNull(Me.Completed) Then Me.AllowEdits = True Me.AllowDeletions = True Else Me.AllowEdits = False Me.AllowDeletions = False End If pbaldy said: http://www.access-programmers.co.uk/forums/showthread.php?t=163908 Click to expand...
Hi, I am using the following code where Completed is a YES/NO, I want to change the following code to Yes/No instead IsNull. How do I do that? Code: If IsNull(Me.Completed) Then Me.AllowEdits = True Me.AllowDeletions = True Else Me.AllowEdits = False Me.AllowDeletions = False End If pbaldy said: http://www.access-programmers.co.uk/forums/showthread.php?t=163908 Click to expand...
pbaldy Wino Moderator Staff member Local time Yesterday, 17:43 Joined Aug 30, 2003 Messages 36,272 Apr 13, 2009 #8 Try If Me.Completed = True Then