Default value for combobox

T

tompen1978

Hi,

I have a problem I have been struggling with for some time now. I have
a conitnuous form with a number of comboboxes showing data from
different queries related to the record in question. My problem is in
refreshing the data for these comboboxes. I use a method to first
requery the underlying query of the box and then select ItemData(0):

Forms![MS_Maintenance].DueMS.Requery
Forms![MS_Maintenance].DueMS = Forms![MS_Maintenance].DueMS.ItemData
(0)

This works perfectly on an individual record. But it only works on an
individual record not as a general refresh of all records on opening
of the form. The way I worked around it was to make a loop that walks
through each record and applies the method above. My problem is that
takes quite some time if there are many records in the list.

Really appreciate some help on this one!

//Thomas
 
S

Software-Matters via AccessMonster.com

Hi,
If you have seperate queries that populate the combo boxes - my advice would
be to add these to the main recordset of the form either as functions or
joined queries. Then you won't have to do any requerying.

Hi,

I have a problem I have been struggling with for some time now. I have
a conitnuous form with a number of comboboxes showing data from
different queries related to the record in question. My problem is in
refreshing the data for these comboboxes. I use a method to first
requery the underlying query of the box and then select ItemData(0):

Forms![MS_Maintenance].DueMS.Requery
Forms![MS_Maintenance].DueMS = Forms![MS_Maintenance].DueMS.ItemData
(0)

This works perfectly on an individual record. But it only works on an
individual record not as a general refresh of all records on opening
of the form. The way I worked around it was to make a loop that walks
through each record and applies the method above. My problem is that
takes quite some time if there are many records in the list.

Really appreciate some help on this one!

//Thomas

--
<a href="
http://www.software-matters.co.uk/bespoke-database-design.html">Bespoke
Access Database Development</a>
<p>Software Matters</br>
Straightforward solutions that work</p>
 
T

tompen1978

Hi,
If you have seperate queries that populate the combo boxes - my advice would
be to add these to the main recordset of the form either as functions or
joined queries. Then you won't have to do any requerying.





I have a problem I have been struggling with for some time now. I have
a conitnuous form with a number of comboboxes showing data from
different queries related to the record in question. My problem is in
refreshing the data for these comboboxes. I use a method to first
requery the underlying query of the box and then select ItemData(0):
Forms![MS_Maintenance].DueMS.Requery
Forms![MS_Maintenance].DueMS = Forms![MS_Maintenance].DueMS.ItemData
(0)
This works perfectly on an individual record. But it only works on an
individual record not as a general refresh of all records on opening
of the form. The way I worked around it was to make a loop that walks
through each record and applies the method above. My problem is that
takes quite some time if there are many records in the list.
Really appreciate some help on this one!

--
<a href="http://www.software-matters.co.uk/bespoke-database-design.html">Bespoke
Access Database Development</a>
<p>Software Matters</br>
Straightforward solutions that work</p>

http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200903/1- Dölj citerad text -

- Visa citerad text -

Thanks for your quick answer!

But I would still have the problem with assigning the ItemData(0)
value to the combobox I guess?
 

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