By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Combo Box - Storing Results

P: n/a
Hi

I am desparately looking for advice in relation to storing the results
after selecting items from two combo boxes on a Referral form. The
first combo box 'ctl Type' displays a full list of Agency Types, then
the 2nd combo box displays a list of Organisations, depending upon the
Agency Type Selected.

The first combo box 'ctlType' (Unbound), Row Source: to field
[OrganisationType] in 'AgencyReferralType'.

The second combo box 'ctlAgency', Row Source: to
[AgencyNameid],[organisationtype],[AgencyName] in 'qryAgencyType'
I have set the criteria for this [organisationtype]to
[forms]![frmreferralto]![ctltype].

The first combo displays the correct sub-list in combo 2 but the
values are empty when the form is re-opened.

Can anyone please provide any feedback as to what I am doing wrong.

Many Many Thanks.
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
There are 2 solutions here. The first would be include a field in the
recordset that stores the value of your first combo box. The second would be
to include code in the On Current Event procedure for your form that looks
at the stored value of the second combo box and displays the correct value
of the first combo box. e.g. using the row sources given
If Not IsNull(Me!ctlAgency.Column(1)) Then
Me!ctlType = Me!ctlAgency.Colomn(1)
End If
"Heather" <he*********@optusnet.com.au> wrote in message
news:9a**************************@posting.google.c om...
Hi

I am desparately looking for advice in relation to storing the results
after selecting items from two combo boxes on a Referral form. The
first combo box 'ctl Type' displays a full list of Agency Types, then
the 2nd combo box displays a list of Organisations, depending upon the
Agency Type Selected.

The first combo box 'ctlType' (Unbound), Row Source: to field
[OrganisationType] in 'AgencyReferralType'.

The second combo box 'ctlAgency', Row Source: to
[AgencyNameid],[organisationtype],[AgencyName] in 'qryAgencyType'
I have set the criteria for this [organisationtype]to
[forms]![frmreferralto]![ctltype].

The first combo displays the correct sub-list in combo 2 but the
values are empty when the form is re-opened.

Can anyone please provide any feedback as to what I am doing wrong.

Many Many Thanks.

Nov 12 '05 #2

P: n/a
I'm not sure I understand your problem. What do you think should be
displayed in the second combo box?

I am assuming you use the change event of the first combo box to
requery the second combo box. What is displayed in the first combo
box when "the form is re-opened"? If you are setting a default value
in the first combo box and you want the second combo box to display
the values associated with the default value, all you need to do is
requery combo 2 on the form's open event.

Let me know if you need some additional info.

Jeff
he*********@optusnet.com.au (Heather) wrote in message news:<9a**************************@posting.google. com>...
Hi

I am desparately looking for advice in relation to storing the results
after selecting items from two combo boxes on a Referral form. The
first combo box 'ctl Type' displays a full list of Agency Types, then
the 2nd combo box displays a list of Organisations, depending upon the
Agency Type Selected.

The first combo box 'ctlType' (Unbound), Row Source: to field
[OrganisationType] in 'AgencyReferralType'.

The second combo box 'ctlAgency', Row Source: to
[AgencyNameid],[organisationtype],[AgencyName] in 'qryAgencyType'
I have set the criteria for this [organisationtype]to
[forms]![frmreferralto]![ctltype].

The first combo displays the correct sub-list in combo 2 but the
values are empty when the form is re-opened.

Can anyone please provide any feedback as to what I am doing wrong.

Many Many Thanks.

Nov 12 '05 #3

P: n/a
What Heather's problem is that the first combo box is unbound and that is
the reason why it's empty when the form is reopened. She has no problem with
the second combo displaying the correct data after an item has been
selected.

Stewart
"jeff colton" <co******@hotmail.com> wrote in message
news:b0**************************@posting.google.c om...
I'm not sure I understand your problem. What do you think should be
displayed in the second combo box?

I am assuming you use the change event of the first combo box to
requery the second combo box. What is displayed in the first combo
box when "the form is re-opened"? If you are setting a default value
in the first combo box and you want the second combo box to display
the values associated with the default value, all you need to do is
requery combo 2 on the form's open event.

Let me know if you need some additional info.

Jeff
he*********@optusnet.com.au (Heather) wrote in message

news:<9a**************************@posting.google. com>...
Hi

I am desparately looking for advice in relation to storing the results
after selecting items from two combo boxes on a Referral form. The
first combo box 'ctl Type' displays a full list of Agency Types, then
the 2nd combo box displays a list of Organisations, depending upon the
Agency Type Selected.

The first combo box 'ctlType' (Unbound), Row Source: to field
[OrganisationType] in 'AgencyReferralType'.

The second combo box 'ctlAgency', Row Source: to
[AgencyNameid],[organisationtype],[AgencyName] in 'qryAgencyType'
I have set the criteria for this [organisationtype]to
[forms]![frmreferralto]![ctltype].

The first combo displays the correct sub-list in combo 2 but the
values are empty when the form is re-opened.

Can anyone please provide any feedback as to what I am doing wrong.

Many Many Thanks.

Nov 12 '05 #4

P: n/a
D
I've been banging my head against this for a long time. This would be a
great thing to do from an interface point of view, but it's breaking my
back! (I'm used to doing everything myself in PHP, so Access' event model is
a bit of a struggle).

My problem is the OnCurrent event with continuous forms. When an item is
chosen from the first combo, the same item is chosen in all the combos on
the form, and the bound values in the second combos disappear.

I also tried creating a bound first combo, but this time the second combo
was buggy in continuous forms.

Anyone explain a bulletproof solution to this?

D


"Stewart Allen" <sa****@REMOVETHISwave.co.nz> wrote in message
news:bn**********@news.wave.co.nz...
There are 2 solutions here. The first would be include a field in the
recordset that stores the value of your first combo box. The second would be to include code in the On Current Event procedure for your form that looks
at the stored value of the second combo box and displays the correct value
of the first combo box. e.g. using the row sources given
If Not IsNull(Me!ctlAgency.Column(1)) Then
Me!ctlType = Me!ctlAgency.Colomn(1)
End If
"Heather" <he*********@optusnet.com.au> wrote in message
news:9a**************************@posting.google.c om...
Hi

I am desparately looking for advice in relation to storing the results
after selecting items from two combo boxes on a Referral form. The
first combo box 'ctl Type' displays a full list of Agency Types, then
the 2nd combo box displays a list of Organisations, depending upon the
Agency Type Selected.

The first combo box 'ctlType' (Unbound), Row Source: to field
[OrganisationType] in 'AgencyReferralType'.

The second combo box 'ctlAgency', Row Source: to
[AgencyNameid],[organisationtype],[AgencyName] in 'qryAgencyType'
I have set the criteria for this [organisationtype]to
[forms]![frmreferralto]![ctltype].

The first combo displays the correct sub-list in combo 2 but the
values are empty when the form is re-opened.

Can anyone please provide any feedback as to what I am doing wrong.

Many Many Thanks.


Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.