[AccessD] 'Cascade' within a single combo box...

Darryl Collins Darryl.Collins at coles.com.au
Thu Feb 28 01:06:48 CST 2008



Thanks for all the advice so far, I am really thinking this is more of a design issue and I think (in this case at least) a minor tweak to the layout will achieve the result the client is looking for without too much stuffing around.  This afternoon has been educational though, so I have learnt more.

many thanks
Darryl.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Dan Waters
Sent: Thursday, 28 February 2008 3:25 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] 'Cascade' within a single combo box...


Hi Darryl,

I do this with bound comboboxes - code below:

----------------------------------------------------------

Private Sub cboCAPACode1_Enter()
On Error GoTo EH

    If IsNull(cboCAPACode2) And IsNull(cboCAPACode3) Then
        cboCAPACode1.RowSource = "SELECT CAPACode FROM tblCAPACodeLU"
    End If
    If Not IsNull(cboCAPACode2) And IsNull(cboCAPACode3) Then
        cboCAPACode1.RowSource = "SELECT CAPACode FROM tblCAPACodeLU" _
            & " WHERE CAPACode <> '" & Forms("frmCAPAMain")("cboCAPACode2")
& "'"
    End If
    If IsNull(cboCAPACode2) And Not IsNull(cboCAPACode3) Then
        cboCAPACode1.RowSource = "SELECT CAPACode FROM tblCAPACodeLU" _
            & " WHERE CAPACode <> '" & Forms("frmCAPAMain")("cboCAPACode3")
& "'"
    End If
    If Not IsNull(cboCAPACode2) And Not IsNull(cboCAPACode3) Then
        cboCAPACode1.RowSource = "SELECT CAPACode FROM tblCAPACodeLU" _
            & " WHERE CAPACode <> '" & Forms("frmCAPAMain")("cboCAPACode2")
& "' AND CAPACode <> '" & Forms("frmCAPAMain")("cboCAPACode3") & "'"
    End If

    Exit Sub

EH:
    Application.Echo True

End Sub

-----------------------------------------------------------

There are 3 comboboxes - if either of the other two have already been used,
then this combobox's RowSource is changed - using the Enter event.  All
three comboboxes have similar code in their Enter events.

This has worked out very well.

HTH!
Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath Pelletti
Sent: Wednesday, February 27, 2008 10:09 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] 'Cascade' within a single combo box...

Darryl - I don't think the answer is going to be simple.....but I think 
others on the list have done this by having an unbound combo for your second

combo box. Initially it has a row source set which includes all 'valid' 
options, but on change of your first combo, the row source of the your 
second (variable unbound) combo changes to all remaining options minus the 
one selected, as you say.

Once a selection from your unbound combo has been made (after update) you 
bind that value in code to the field.

(The second combo has to be unbound because if you keep it bound your other 
recs on the continuous form will be temporarily invalidated....)

There have been some posts on this topic a while back - if you can't find 
them in the archive I can fwd a couple of relevant ones to you offline...

hth
Kath

----- Original Message ----- 
From: "Darryl Collins" <Darryl.Collins at coles.com.au>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Thursday, February 28, 2008 2:41 PM
Subject: [AccessD] 'Cascade' within a single combo box...


> Hey all,
>
> This is probably easy (i sure hope so) but I am having a brain freeze 
> today.  I have a continuous form with a combo box on it.  Ideally when the

> user chooses one option form the combo box the next box should only have 
> available the remaining options (less the one chosen) etc etc - similar to

> having casading combo boxes (only I just want the one).
>
> Actually, this could be set up all wrong using a continuous form when I 
> think about it.
>
> Is this possible to do, and am I approaching this the correct way? (I 
> suspect not).
>
> regards
> Darryl.
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Drew Wutka
> Sent: Thursday, 28 February 2008 8:09 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Access 2000/2003
>
>
> Depends, when you run something with the task scheduler, you should have
> the option to 'run as' with a specific account.  Otherwise, it probably
> runs under the local system account.
>
> Drew
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> ebarro at verizon.net
> Sent: Wednesday, February 27, 2008 2:49 PM
> To: accessd at databaseadvisors.com
> Subject: [AccessD] Access 2000/2003
>
> Jim,
>
> Check permissions on the app. For the task scheduler check what
> credentials are being used to run it under. When you run it manually you
> are using your login credentials. Is it the same as the credentials used
> by running it in Task Scheduler?
>
> Eric
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> The information contained in this transmission is intended only for the 
> person or entity to which it is addressed and may contain II-VI 
> Proprietary and/or II-VI Business Sensitive material. If you are not the 
> intended recipient, please contact the sender immediately and destroy the 
> material in its entirety, whether electronic or hard copy. You are 
> notified that any review, retransmission, copying, disclosure, 
> dissemination, or other use of, or taking of any action in reliance upon 
> this information by persons or entities other than the intended recipient 
> is prohibited.
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> This email and any attachments may contain privileged and confidential 
> information and are intended for the named addressee only. If you have 
> received this e-mail in error, please notify the sender and delete this 
> e-mail immediately. Any confidentiality, privilege or copyright is not 
> waived or lost because this e-mail has been sent to you in error. It is 
> your responsibility to check this e-mail and any attachments for viruses. 
> No warranty is made that this material is free from computer virus or any 
> other defect or error.  Any loss/damage incurred by using this material is

> not the sender's responsibility.  The sender's entire liability will be 
> limited to resupplying the material.
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

This email and any attachments may contain privileged and confidential information and are intended for the named addressee only. If you have received this e-mail in error, please notify the sender and delete this e-mail immediately. Any confidentiality, privilege or copyright is not waived or lost because this e-mail has been sent to you in error. It is your responsibility to check this e-mail and any attachments for viruses.  No warranty is made that this material is free from computer virus or any other defect or error.  Any loss/damage incurred by using this material is not the sender's responsibility.  The sender's entire liability will be limited to resupplying the material.




More information about the AccessD mailing list