Multiple combo boxes

  • Thread starter Thread starter heather
  • Start date Start date
H

heather

I have created a (sub)combo box that sources its items
from another combo box.
The 1st combo box selects groups which determine what
filtered items can be selected in the 2nd.

The selected item is recorded in the field within the
table BUT when you close and then return to the 'form' the
field is blank. How do you store the record in the form.

Many thanks.
 
-----Original Message-----
I have created a (sub)combo box that sources its items
from another combo box.
The 1st combo box selects groups which determine what
filtered items can be selected in the 2nd.

The selected item is recorded in the field within the
table BUT when you close and then return to the 'form' the
field is blank. How do you store the record in the form.

Many thanks.
.
Your question is a little confusing because you
can't "store" anything in a form! That's not what they
are for. You can certainly "display" information in a
form based on an underlying table or query.

Also, which field is blank? The first combo box, the
second? Be more specific.

I suspect your answer lies in the DoCmd.Requery method,
but I'm not sure based on the information you've suppled.
Best of Luck!
 
Hi Marty,

Many thanks for your response. I have included the
Docmd.requery in the code and I am aware that the table
stores the form - not the form, however when I select an
item from the first combo; the 2nd combo displays the
correct (sub)group which I can also select from - but once
the form is closed and re-opened both fields are blank.

Grateful if you can be of any assistance.
cheers, Heather
 
heather said:
Many thanks for your response. I have included the
Docmd.requery in the code and I am aware that the table
stores the form - not the form, however when I select an
item from the first combo; the 2nd combo displays the
correct (sub)group which I can also select from - but once
the form is closed and re-opened both fields are blank.

Heather,

are the combos bound? I.e. is there something in the ControlSource
property?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Thanks
The 1st combo (ctlType) is Unbound - Row Source, say -
qryTable1.
the 2nd combo is Bound - Control Source, Table1, Row
Source, Table1 with (ctlType) in criteria.

Many Many thanks,
Heather
 
Heather said:
The 1st combo (ctlType) is Unbound - Row Source, say -
qryTable1.
the 2nd combo is Bound - Control Source, Table1, Row
Source, Table1 with (ctlType) in criteria.

Heather,

that's the problem. The 2nd combo depends on the first, so it's empty
when the first one is empty and a Requery is done. And the first one
will be empty when opening the form because it's unbound. The same
(probably?) when you're navigating in the form without choosing
anything in the first combo.

You can either set the appropriate value in the first combo in the
form's OnCurrent event procedure depending on what's in the 2nd combo,
or maybe delete the Requery statement in this procedure (I didn't read
the earlier messages, so I don't know exactly where the Requery is
done - I guess in the combo's AfterUpdate and the form's OnCurrent
events).

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Back
Top