PC Review


Reply
Thread Tools Rate Thread

Problem with after update code in field that disables another field

 
 
SamJ
Guest
Posts: n/a
 
      25th Feb 2008
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

 
Reply With Quote
 
 
 
 
Al Campagna
Guest
Posts: n/a
 
      25th Feb 2008
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.

--
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."

"SamJ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
SamJ
Guest
Posts: n/a
 
      25th Feb 2008
In article <(E-Mail Removed)>,
(E-Mail Removed) says...
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code disables Undo command ktoth04 Microsoft Excel Programming 11 7th Mar 2008 11:26 PM
Code launches Mail Merge but disables the Mail Merge austris Microsoft Excel Misc 0 14th Oct 2006 01:11 AM
Installing hardware update from Windows Update disables 2nd video =?Utf-8?B?R1I=?= Windows XP Help 4 16th Jun 2005 08:15 PM
Applying Security Update (KB823182) disables NIC Felix Windows XP Networking 0 27th Oct 2003 08:40 PM
Critical update disables Netscape Mary Nordstrom Windows XP Security 0 22nd Aug 2003 10:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:44 PM.