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 / August 2006

Tip: Looking for answers? Try searching our database.

Greyed out controls staying greyed when not applicable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jenny - 21 Aug 2006 14:24 GMT
Hi

The value of a combo box (cboSourceOpp) makes some following controls
invalid.  I grey out the invalid controls as follows:

If Me!cboSourceOpp = "Other" Then
 Me!OtherNotes.Enabled = True
 Me!ContactNotes.Enabled = False
 Me!cboOrganisationName.Enabled = False

ElseIf Me!cboSourceOpp = "Contact" Then
 Me!OtherNotes.Enabled = False
 Me!ContactNotes.Enabled = True
 Me!cboOrganisationName.Enabled = True
 
ElseIf Me!cboSourceOpp = "Networking" Then
 Me!OtherNotes.Enabled = False
 Me!ContactNotes.Enabled = False
 Me!cboOrganisationName.Enabled = False
 
ElseIf Me!cboSourceOpp = "Formal Tender" Then
 Me!OtherNotes.Enabled = False
 Me!ContactNotes.Enabled = False
 Me!cboOrganisationName.Enabled = False

End If

This works while entering data, but there is a problem when browsing through
records.  It seems that the enabled true / false setting for whichever record
was last accessed remains for all of them - so, a record with an entry in
SourceOpp of 'Other' will enable 'othernotes' while the data is being
entered, if I go back to look at that record later, 'othernotes' may be
greyed out.  What am I doing wrong?  Can anyone help?

thanks
Ofer Cohen - 21 Aug 2006 14:49 GMT
You can either set this code on the OnCurrent event of the form, or better,
call the AfterUpdate event of the Combo (where I assume this code is located
in) in the OnCurrent event of the form

Call ComboName_AfterUpdate()

That way you need to maintain the code in only one place.

Signature

Good Luck
BS"D

> Hi
>
[quoted text clipped - 31 lines]
>
> thanks
Jenny - 21 Aug 2006 15:01 GMT
Thank you so much - I used Call ComboName_AfterUpdate() in the OnCurrent
event and that works fine.  

Jenny

> You can either set this code on the OnCurrent event of the form, or better,
> call the AfterUpdate event of the Combo (where I assume this code is located
[quoted text clipped - 40 lines]
> >
> > 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.