A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Another cascading combo challenge



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2010, 07:39 AM posted to microsoft.public.access.forms
Joe
external usenet poster
 
Posts: 1,218
Default Another cascading combo challenge

Hi -

I have a subform with two combos CboMechanism with row source = TblMechanism
and CboSubMechanism dependent on selection in CboMechanism using the
following code in CboMechanism Afer Update event...

Private Sub CboMechanism_AfterUpdate()
On Error Resume Next
Select Case CboMechanism.Value
Case "7"
CboSubMechanism.RowSource = "tbl_SubMechEquipt"
Case "9"
CboSubMechanism.RowSource = "tbl_SubMechFall"
Case "10"
CboSubMechanism.RowSource = "tbl_SubMechLift"
Case "11"
CboSubMechanism.RowSource = "tbl_SubMechParachute"
Case "14"
CboSubMechanism.RowSource = "tbl_SubMechSlip"
Case "16"
End Select
This works well when the cases are selected but does not clear
CboSubMechanism when a non-case selection is made.

I tried adding CboSubMechanism.RowSource = "tbl_SubMechMTA" in the After
Update but it doesn't really resolve the problem. I've tried requerying in
after update event without it resolving the issue.

I would be grateful for any guidance offered.
--
Joe
  #2  
Old May 18th, 2010, 01:08 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Another cascading combo challenge

What do you mean by "does not clear CboSubMechanism"? Are you saying that
CboSubMechanism still has a row selected in it, or are you simply that
CboSubMechanism still has content?

To unselect from CboSubMechanism, use

Me!CboSubMechanism = Null

To ensure CboSubMechanism has no data in it, use

Me!CboSubMechanism.RowSource = vbNullString
Me!CboSubMechanism.Requery

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Joe" wrote in message
...
Hi -

I have a subform with two combos CboMechanism with row source =
TblMechanism
and CboSubMechanism dependent on selection in CboMechanism using the
following code in CboMechanism Afer Update event...

Private Sub CboMechanism_AfterUpdate()
On Error Resume Next
Select Case CboMechanism.Value
Case "7"
CboSubMechanism.RowSource = "tbl_SubMechEquipt"
Case "9"
CboSubMechanism.RowSource = "tbl_SubMechFall"
Case "10"
CboSubMechanism.RowSource = "tbl_SubMechLift"
Case "11"
CboSubMechanism.RowSource = "tbl_SubMechParachute"
Case "14"
CboSubMechanism.RowSource = "tbl_SubMechSlip"
Case "16"
End Select
This works well when the cases are selected but does not clear
CboSubMechanism when a non-case selection is made.

I tried adding CboSubMechanism.RowSource = "tbl_SubMechMTA" in the After
Update but it doesn't really resolve the problem. I've tried requerying
in
after update event without it resolving the issue.

I would be grateful for any guidance offered.
--
Joe



  #3  
Old May 19th, 2010, 08:33 AM posted to microsoft.public.access.forms
Joe
external usenet poster
 
Posts: 1,218
Default Another cascading combo challenge

Doug, Thanks for your help.

Using Me!CboSubMechanism = Null

1. If ‘crush’ (not one of the ‘case’ options) is selected, second combo
initially shows correct empty of options.

2. When “fall” (a ‘case’ option) is selected second combo lists options
related to ‘fall’ as required.

3. If “parachuting’ (‘case’ option’ is selected second combo properly lists
options related to “parachuting” as expected.

4. If “Stretch” (not ‘case’ option) is then selected CboSubMechanism still
retains the options for the last ‘case’ selected. No options should be
available for this selection!

When
Me!CboSubMechanism.RowSource = VbNullString
Me!CboSubMechanism.Requery
are used none of the options populate for the 'case' selections in
CboMechanism.

I'm not sure where to go from here. I've tried combinations of the above
just to eliminate that option but no go.
--
Joe


"Douglas J. Steele" wrote:

What do you mean by "does not clear CboSubMechanism"? Are you saying that
CboSubMechanism still has a row selected in it, or are you simply that
CboSubMechanism still has content?

To unselect from CboSubMechanism, use

Me!CboSubMechanism = Null

To ensure CboSubMechanism has no data in it, use

Me!CboSubMechanism.RowSource = vbNullString
Me!CboSubMechanism.Requery

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Joe" wrote in message
...
Hi -

I have a subform with two combos CboMechanism with row source =
TblMechanism
and CboSubMechanism dependent on selection in CboMechanism using the
following code in CboMechanism Afer Update event...

Private Sub CboMechanism_AfterUpdate()
On Error Resume Next
Select Case CboMechanism.Value
Case "7"
CboSubMechanism.RowSource = "tbl_SubMechEquipt"
Case "9"
CboSubMechanism.RowSource = "tbl_SubMechFall"
Case "10"
CboSubMechanism.RowSource = "tbl_SubMechLift"
Case "11"
CboSubMechanism.RowSource = "tbl_SubMechParachute"
Case "14"
CboSubMechanism.RowSource = "tbl_SubMechSlip"
Case "16"
End Select
This works well when the cases are selected but does not clear
CboSubMechanism when a non-case selection is made.

I tried adding CboSubMechanism.RowSource = "tbl_SubMechMTA" in the After
Update but it doesn't really resolve the problem. I've tried requerying
in
after update event without it resolving the issue.

I would be grateful for any guidance offered.
--
Joe



.

  #4  
Old May 20th, 2010, 02:12 AM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Another cascading combo challenge

Please the entire routine as you've changed it.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)



"Joe" wrote in message
...
Doug, Thanks for your help.

Using Me!CboSubMechanism = Null

1. If ‘crush’ (not one of the ‘case’ options) is selected, second combo
initially shows correct empty of options.

2. When “fall” (a ‘case’ option) is selected second combo lists options
related to ‘fall’ as required.

3. If “parachuting’ (‘case’ option’ is selected second combo properly
lists
options related to “parachuting” as expected.

4. If “Stretch” (not ‘case’ option) is then selected CboSubMechanism still
retains the options for the last ‘case’ selected. No options should be
available for this selection!

When
Me!CboSubMechanism.RowSource = VbNullString
Me!CboSubMechanism.Requery
are used none of the options populate for the 'case' selections in
CboMechanism.

I'm not sure where to go from here. I've tried combinations of the above
just to eliminate that option but no go.
--
Joe


"Douglas J. Steele" wrote:

What do you mean by "does not clear CboSubMechanism"? Are you saying that
CboSubMechanism still has a row selected in it, or are you simply that
CboSubMechanism still has content?

To unselect from CboSubMechanism, use

Me!CboSubMechanism = Null

To ensure CboSubMechanism has no data in it, use

Me!CboSubMechanism.RowSource = vbNullString
Me!CboSubMechanism.Requery

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Joe" wrote in message
...
Hi -

I have a subform with two combos CboMechanism with row source =
TblMechanism
and CboSubMechanism dependent on selection in CboMechanism using the
following code in CboMechanism Afer Update event...

Private Sub CboMechanism_AfterUpdate()
On Error Resume Next
Select Case CboMechanism.Value
Case "7"
CboSubMechanism.RowSource = "tbl_SubMechEquipt"
Case "9"
CboSubMechanism.RowSource = "tbl_SubMechFall"
Case "10"
CboSubMechanism.RowSource = "tbl_SubMechLift"
Case "11"
CboSubMechanism.RowSource = "tbl_SubMechParachute"
Case "14"
CboSubMechanism.RowSource = "tbl_SubMechSlip"
Case "16"
End Select
This works well when the cases are selected but does not clear
CboSubMechanism when a non-case selection is made.

I tried adding CboSubMechanism.RowSource = "tbl_SubMechMTA" in the
After
Update but it doesn't really resolve the problem. I've tried
requerying
in
after update event without it resolving the issue.

I would be grateful for any guidance offered.
--
Joe



.


  #5  
Old May 20th, 2010, 09:04 AM posted to microsoft.public.access.forms
Joe
external usenet poster
 
Posts: 1,218
Default Another cascading combo challenge

Hi Doug - You are a champion!
When I reviewed the code I found that I had just appended the
Me!CboSubMechanism.RowSource = VbNullString
Me!CboSubMechanism.Requery
after the End Select. I forgot to look at what the code was actually doing -
doh!

All is well now that I have put the code at the beginning of the routine .

Many thanks for your patient help. You MVP's are always so helpful and it
is greatly appreciated.
--
Joe


"Douglas J. Steele" wrote:

Please the entire routine as you've changed it.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)



"Joe" wrote in message
...
Doug, Thanks for your help.

Using Me!CboSubMechanism = Null

1. If ‘crush’ (not one of the ‘case’ options) is selected, second combo
initially shows correct empty of options.

2. When “fall” (a ‘case’ option) is selected second combo lists options
related to ‘fall’ as required.

3. If “parachuting’ (‘case’ option’ is selected second combo properly
lists
options related to “parachuting” as expected.

4. If “Stretch” (not ‘case’ option) is then selected CboSubMechanism still
retains the options for the last ‘case’ selected. No options should be
available for this selection!

When
Me!CboSubMechanism.RowSource = VbNullString
Me!CboSubMechanism.Requery
are used none of the options populate for the 'case' selections in
CboMechanism.

I'm not sure where to go from here. I've tried combinations of the above
just to eliminate that option but no go.
--
Joe


"Douglas J. Steele" wrote:

What do you mean by "does not clear CboSubMechanism"? Are you saying that
CboSubMechanism still has a row selected in it, or are you simply that
CboSubMechanism still has content?

To unselect from CboSubMechanism, use

Me!CboSubMechanism = Null

To ensure CboSubMechanism has no data in it, use

Me!CboSubMechanism.RowSource = vbNullString
Me!CboSubMechanism.Requery

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Joe" wrote in message
...
Hi -

I have a subform with two combos CboMechanism with row source =
TblMechanism
and CboSubMechanism dependent on selection in CboMechanism using the
following code in CboMechanism Afer Update event...

Private Sub CboMechanism_AfterUpdate()
On Error Resume Next
Select Case CboMechanism.Value
Case "7"
CboSubMechanism.RowSource = "tbl_SubMechEquipt"
Case "9"
CboSubMechanism.RowSource = "tbl_SubMechFall"
Case "10"
CboSubMechanism.RowSource = "tbl_SubMechLift"
Case "11"
CboSubMechanism.RowSource = "tbl_SubMechParachute"
Case "14"
CboSubMechanism.RowSource = "tbl_SubMechSlip"
Case "16"
End Select
This works well when the cases are selected but does not clear
CboSubMechanism when a non-case selection is made.

I tried adding CboSubMechanism.RowSource = "tbl_SubMechMTA" in the
After
Update but it doesn't really resolve the problem. I've tried
requerying
in
after update event without it resolving the issue.

I would be grateful for any guidance offered.
--
Joe


.


.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.