Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / September 2005

Tip: Looking for answers? Try searching our database.

Turning off all fields.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ted Clore - 20 Sep 2005 13:58 GMT
I would like to turn off all fields when a check box is checked so no more
data can be entered into a record.

Suggestions?

Thank you.
Ted Clore
Al Camp - 20 Sep 2005 14:50 GMT
  Use the AfterUpdate event of your checkbox to turn the form's AllowEdits
= False.
  Also, you'll need to use the OnCurrent event to check the value of the
checkbox, and turn AllowEdits to True or False accordingly.
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

>I would like to turn off all fields when a check box is checked so no more
>data can be entered into a record.
[quoted text clipped - 3 lines]
> Thank you.
> Ted Clore
Ted Clore - 20 Sep 2005 16:07 GMT
I am a Access dummy, could you be a little more specific please.  I am not
sure what you mean below.

Thank you Al.

Ted

>   Use the AfterUpdate event of your checkbox to turn the form's AllowEdits
> = False.
[quoted text clipped - 12 lines]
>> Thank you.
>> Ted Clore
Al Camp - 20 Sep 2005 20:42 GMT
Let's say your checkbox is named Locked, bound to field Locked in your
table.

Use this code in the AfterUpdate event of [Locked]...

   Private Sub Locked_AfterUpdate()
       If [Locked] = True Then
           Me.AllowEdits = False
       Else
           Me.AllowEdits = True
       End If
   End Sub

Use this code in the OnCurrent event of the form itself...

   Private Sub Form_Current()
       If [Locked] = True Then
           Me.AllowEdits = False
       Else
           Me.AllowEdits = True
       End If
   End Sub

hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

>I am a Access dummy, could you be a little more specific please.  I am not
>sure what you mean below.
[quoted text clipped - 19 lines]
>>> Thank you.
>>> Ted Clore
Ted Clore - 26 Sep 2005 14:01 GMT
I give up.  I have tried this any which way, and I am still not able to do
anything.  Usually get an error message that says event can not contain
comments.

Thanks for your help Al, I just am not savvy enough with Access to do this.

Thanks again,
Ted

> Let's say your checkbox is named Locked, bound to field Locked in your
> table.
[quoted text clipped - 47 lines]
>>>> Thank you.
>>>> Ted Clore
Al Camp - 28 Sep 2005 13:46 GMT
Ted,
  I'll try to help, but I need to see your code... along with a deatiled
description of WHERE and HOW you entered that code.

  Do you have any experience with writing event code in the form module?

  Let me review the procedure just in case... I'm using the name Locked...
you use your own field name.

  In design view, select the Locked field.
  In the Properties box for Locked, find the AfterUpdate event, and place
your cursor in it.
  Use the little arrow on the right to select Event Procedure from the
list.
  Now click the little button on the right with 3 dots ...
  You are now in the form module, and should see...
-------------------------------------
   Private Sub Locked_AfterUpdate()

   End Sub
-------------------------------------

   Place the code I gave you between those 2 lines...

--------------------------------------
   Private Sub Locked_AfterUpdate()
       If [Locked] = True Then
           Me.AllowEdits = False
       Else
           Me.AllowEdits = True
       End If
   End Sub
-------------------------------

   Just try that... in Form view set Locked to True, and see if you can
edit the record afterwards.

   Do the same procedure for the OnCurrent event of the Form.

   Hang in there...
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

>I give up.  I have tried this any which way, and I am still not able to do
>anything.  Usually get an error message that says event can not contain
[quoted text clipped - 57 lines]
>>>>> Thank you.
>>>>> Ted Clore
tina - 28 Sep 2005 14:26 GMT
hi Al. i saw Ted's last post, more or less throwing in the towel, so i did
some screen prints illustrating how to implement your solution (a picture's
worth...) and emailed it to him in a .pdf file. (i'm doing some "how to" pdf
files for a project, so it was an opportunity for me to test my premise.) he
emailed back and said your solution worked fine, once he saw how to set up a
VBA procedure.

tina  :)

> Ted,
>    I'll try to help, but I need to see your code... along with a deatiled
[quoted text clipped - 102 lines]
> >>>>> Thank you.
> >>>>> Ted Clore
Al Camp - 29 Sep 2005 14:16 GMT
Tina,
  Yes... that's why I asked about his experience, and then laid it out as
clearly as I could.
  I think he was trying to enter the code in the property box AfterUpdate
"field" instead of the module.

  Thanks  for the feedback Tina... glad it all worked it out...
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Thanks for getting back to me
> hi Al. i saw Ted's last post, more or less throwing in the towel, so i did
> some screen prints illustrating how to implement your solution (a
[quoted text clipped - 119 lines]
>> >>>>> Thank you.
>> >>>>> Ted Clore
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.