PC Review


Reply
Thread Tools Rate Thread

Display/Hide a Form Control/Field Based On Another Field Value?

 
 
PowerLifter1450@gmail.com
Guest
Posts: n/a
 
      31st Oct 2007
Hi all, I have to Combo boxes on a form. The first one I would always
like users to see. The second, however, I would like hidden if the
first box has certain values selected. So, if ComboBox1 has values of
1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a
value of 3, I would like ComboBox2 hidden. Is there a relatively
simple way of doing this, if at all? Thanks for your help as always!

--Eric

 
Reply With Quote
 
 
 
 
=?Utf-8?B?bXNjZXJ0aWZpZWQ=?=
Guest
Posts: n/a
 
      31st Oct 2007
You have to take care of 2 things:
(1) When you move from record to record and the combo box contents changes
(2) When the user changes the contents of the combo box

For (1), insert some code in the OnCurrent event for the form
For (2), insert some code in the AfterUpdate event for ComboBox1

Code:
If Me!ComboBox1 = "1" or Me!ComboBox1 = "2" Then
Me!ComboBox2.Visible = True
Else
Me!ComboBox2.Visible = False
EndIf

-Dorian

"(E-Mail Removed)" wrote:

> Hi all, I have to Combo boxes on a form. The first one I would always
> like users to see. The second, however, I would like hidden if the
> first box has certain values selected. So, if ComboBox1 has values of
> 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a
> value of 3, I would like ComboBox2 hidden. Is there a relatively
> simple way of doing this, if at all? Thanks for your help as always!
>
> --Eric
>
>

 
Reply With Quote
 
tina
Guest
Posts: n/a
 
      1st Nov 2007
add the following code to ComboBox1's AfterUpdate event procedure, AND to
the form's Current event procedure, as

Me!ComboBox2.Visible = Not (Me!ComboBox1 = 3)

hth


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all, I have to Combo boxes on a form. The first one I would always
> like users to see. The second, however, I would like hidden if the
> first box has certain values selected. So, if ComboBox1 has values of
> 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a
> value of 3, I would like ComboBox2 hidden. Is there a relatively
> simple way of doing this, if at all? Thanks for your help as always!
>
> --Eric
>



 
Reply With Quote
 
PowerLifter1450@gmail.com
Guest
Posts: n/a
 
      1st Nov 2007
On Oct 31, 9:44 pm, "tina" <nos...@address.com> wrote:
> add the following code to ComboBox1's AfterUpdate event procedure, AND to
> the form's Current event procedure, as
>
> Me!ComboBox2.Visible = Not (Me!ComboBox1 = 3)
>
> hth
>
> <PowerLifter1...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > Hi all, I have to Combo boxes on a form. The first one I would always
> > like users to see. The second, however, I would like hidden if the
> > first box has certain values selected. So, if ComboBox1 has values of
> > 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a
> > value of 3, I would like ComboBox2 hidden. Is there a relatively
> > simple way of doing this, if at all? Thanks for your help as always!

>
> > --Eric- Hide quoted text -

>
> - Show quoted text -


Hi Tina, thanks for the quick response. I inserted a variation of the
code in both place, but now get a run-time error on the After Update
procedure of the combo box that says "Object doesn't support this
property or method." Did I do anything to the code that messed it up?
-->

Me!AcceptStatus.Visible = (Me!AppStatus = "No Application")

Thanks for your help,,

--Eric

 
Reply With Quote
 
PowerLifter1450@gmail.com
Guest
Posts: n/a
 
      1st Nov 2007
On Oct 31, 6:51 pm, mscertified <rup...@tigerlily.com> wrote:
> You have to take care of 2 things:
> (1) When you move from record to record and the combo box contents changes
> (2) When the user changes the contents of the combo box
>
> For (1), insert some code in the OnCurrent event for the form
> For (2), insert some code in the AfterUpdate event for ComboBox1
>
> Code:
> If Me!ComboBox1 = "1" or Me!ComboBox1 = "2" Then
> Me!ComboBox2.Visible = True
> Else
> Me!ComboBox2.Visible = False
> EndIf
>
> -Dorian
>
>
>
> "PowerLifter1...@gmail.com" wrote:
> > Hi all, I have to Combo boxes on a form. The first one I would always
> > like users to see. The second, however, I would like hidden if the
> > first box has certain values selected. So, if ComboBox1 has values of
> > 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a
> > value of 3, I would like ComboBox2 hidden. Is there a relatively
> > simple way of doing this, if at all? Thanks for your help as always!

>
> > --Eric- Hide quoted text -

>
> - Show quoted text -


Thanks for the help too Dorian. I tried the IF statement, and I get
the "Object doesn't support this property or method" for this line:
Me!AcceptStatus.Visible = True ..... and it probably point to the
false line when the condition is false. Any idea what I did to mess it
up? Thanks,

--Eric

 
Reply With Quote
 
=?Utf-8?B?bXNjZXJ0aWZpZWQ=?=
Guest
Posts: n/a
 
      1st Nov 2007
Make sure you are using the 'name' of the control (name property) not the
bound field name.

-Dorian

"(E-Mail Removed)" wrote:

> On Oct 31, 6:51 pm, mscertified <rup...@tigerlily.com> wrote:
> > You have to take care of 2 things:
> > (1) When you move from record to record and the combo box contents changes
> > (2) When the user changes the contents of the combo box
> >
> > For (1), insert some code in the OnCurrent event for the form
> > For (2), insert some code in the AfterUpdate event for ComboBox1
> >
> > Code:
> > If Me!ComboBox1 = "1" or Me!ComboBox1 = "2" Then
> > Me!ComboBox2.Visible = True
> > Else
> > Me!ComboBox2.Visible = False
> > EndIf
> >
> > -Dorian
> >
> >
> >
> > "PowerLifter1...@gmail.com" wrote:
> > > Hi all, I have to Combo boxes on a form. The first one I would always
> > > like users to see. The second, however, I would like hidden if the
> > > first box has certain values selected. So, if ComboBox1 has values of
> > > 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a
> > > value of 3, I would like ComboBox2 hidden. Is there a relatively
> > > simple way of doing this, if at all? Thanks for your help as always!

> >
> > > --Eric- Hide quoted text -

> >
> > - Show quoted text -

>
> Thanks for the help too Dorian. I tried the IF statement, and I get
> the "Object doesn't support this property or method" for this line:
> Me!AcceptStatus.Visible = True ..... and it probably point to the
> false line when the condition is false. Any idea what I did to mess it
> up? Thanks,
>
> --Eric
>
>

 
Reply With Quote
 
tina
Guest
Posts: n/a
 
      2nd Nov 2007
well, i don't know. does it work when called from the form's Current event?
are AcceptStatus and AppStatus the names of *controls* in the form?

hth


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Oct 31, 9:44 pm, "tina" <nos...@address.com> wrote:
> > add the following code to ComboBox1's AfterUpdate event procedure, AND

to
> > the form's Current event procedure, as
> >
> > Me!ComboBox2.Visible = Not (Me!ComboBox1 = 3)
> >
> > hth
> >
> > <PowerLifter1...@gmail.com> wrote in message
> >
> > news:(E-Mail Removed)...
> >
> >
> >
> > > Hi all, I have to Combo boxes on a form. The first one I would always
> > > like users to see. The second, however, I would like hidden if the
> > > first box has certain values selected. So, if ComboBox1 has values of
> > > 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a
> > > value of 3, I would like ComboBox2 hidden. Is there a relatively
> > > simple way of doing this, if at all? Thanks for your help as always!

> >
> > > --Eric- Hide quoted text -

> >
> > - Show quoted text -

>
> Hi Tina, thanks for the quick response. I inserted a variation of the
> code in both place, but now get a run-time error on the After Update
> procedure of the combo box that says "Object doesn't support this
> property or method." Did I do anything to the code that messed it up?
> -->
>
> Me!AcceptStatus.Visible = (Me!AppStatus = "No Application")
>
> Thanks for your help,,
>
> --Eric
>



 
Reply With Quote
 
PowerLifter1450@gmail.com
Guest
Posts: n/a
 
      3rd Nov 2007
On Nov 1, 11:03 am, mscertified <rup...@tigerlily.com> wrote:
> Make sure you are using the 'name' of the control (name property) not the
> bound field name.
>
> -Dorian



Yeah, that helps ! :-)

Thanks for your help guys !!

--Eric

 
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
Show Hide field on a form based on condition Khalil handal Microsoft Access 2 21st Oct 2008 03:07 PM
Display/Hide a Form Control/Field Based On Another Field Value? PowerLifter1450@gmail.com Microsoft Access Forms 7 3rd Nov 2007 08:27 PM
display memo field on a form based on the value of another field =?Utf-8?B?SmVycnkgaW4gdGhlIERlc2VydC4=?= Microsoft Access 2 14th Jun 2007 03:35 PM
Hide a button based on the value in another field on the form =?Utf-8?B?U2FuZHk=?= Microsoft Access Forms 5 8th Feb 2007 03:23 AM
Re: Display a field on a form based on certain criteria Gerald Stanley Microsoft Access Forms 0 17th Mar 2004 05:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:34 PM.