Saved value not displaying

K

Karen

I have a form with 2 comboboxes. The rowsource of the second combobox depends on the choice made in the first combobox. Both comboboxes are bound controls.

combobox1 is a 2 column combobox with an index in column 1 and associated Agency Name in column 2

I choose a value in combobox1 then I set the rowsource of combobox2 to only show Agents who work for the Agency selected in combobox1.

combobox2 is also a 2 column combobox with an index in column1 and the associated Agent Name in column 2.

When I close the form and reopen, the previously selected value in combobox1 is displayed but the previously selected value in combobox2 is not displayed; the underlying table has stored the key for the Agent name, the combobox2 just doesn't display.

What really dumb thing am I not doing?
 
M

MacDermott

You could get this effect if the RowSource for Combo2 doesn't include the
selected data when you open the form.

HTH
- Turtle

BTW - more people can read your posts if you use plain text.


I have a form with 2 comboboxes. The rowsource of the second combobox
depends on the choice made in the first combobox. Both comboboxes are bound
controls.

combobox1 is a 2 column combobox with an index in column 1 and associated
Agency Name in column 2

I choose a value in combobox1 then I set the rowsource of combobox2 to only
show Agents who work for the Agency selected in combobox1.

combobox2 is also a 2 column combobox with an index in column1 and the
associated Agent Name in column 2.

When I close the form and reopen, the previously selected value in combobox1
is displayed but the previously selected value in combobox2 is not
displayed; the underlying table has stored the key for the Agent name, the
combobox2 just doesn't display.

What really dumb thing am I not doing?
 
K

Karen

Thanks Turtle,

Seems like I just wasn't thinking straight, I was saving the index but not
using a subform so there was no way to pull up the corresponding name.

Karen
 
B

Baisong Wei[MSFT]

Hi Karen,

Thank you for using the newsgroup and it is my pleasure to help you with
your issue.

As you metioned that 'When I close the form and reopen, the previously
selected value in combobox1 is displayed but the previously selected value
in combobox2 is not displayed', I do think you could use the On Open event
of the form, that is, when the form is opened ,the you could reset the the
value in the combobox2 according to the value displayed in the combobox1.

Hope this helps and if you still have questions, please feel free to post
new messge here and I am ready to help!

Thanks,

Best regards

Baisong Wei
Microsoft Online Support
 
K

Karen

Thanks Baisong,

That would work also. I did figure it out, almost all of the problem was my
being tired and making a stupid mistake.

Karen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top