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 / Forms / February 2008

Tip: Looking for answers? Try searching our database.

Problem with after update code in field that disables another field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SamJ - 25 Feb 2008 09:46 GMT
Hi

I want to be able to disable the Non Member field in a record when
something is entered in the Member field. Unfortunately, the code I am
usng below disables the Non Member field in *all* records, and the
database has to be closed and reopened to get round this before data
entry can continue.

I'd be grateful if someone could show me the correction, Thanks.

Private Sub Member_AfterUpdate()

If Not IsNull([Member]) Then
Me![Non Members].Enabled = False
Else
Me![Non Members].Enabled = True
End If
End Sub
Al Campagna - 25 Feb 2008 13:21 GMT
Sam,
  You need to put that same code in on the OnCurrent event of the form.
  When you programatically disable a field during a form "session" it will
disable that field on all records.
  Using your code in the OnCurrent event of the form, allows you to examine
the Member value of that record, and Enable/Disable accordingly.

Signature

   hth
   Al Campagna
   Microsoft Access MVP
   http://home.comcast.net/~cccsolutions/index.html

   "Find a job that you love... and you'll never work a day in your life."

> Hi
>
[quoted text clipped - 14 lines]
> End If
> End Sub
SamJ - 25 Feb 2008 15:12 GMT
> Sam,
>    You need to put that same code in on the OnCurrent event of the form.
>    When you programatically disable a field during a form "session" it will
> disable that field on all records.
>    Using your code in the OnCurrent event of the form, allows you to examine
> the Member value of that record, and Enable/Disable accordingly.

Ok, thanks.
 
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.