473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Wait until ComboBox Requery complete

Hi,

I'm requering a combobox, and attempting to
a) force it to have the first item selected instead of no item
selected
b) use values in hidden columns of the combobox for the selected item

Currently the code looks like this:

'....
cmbBatches.Requery
If (cmbBatches.Recordset.RecordCount > 0) Then
cmbBatches.value = cmbBatches.Recordset.Fields(0).value
'...
something = cmbBatches.Recordset.Fields("BTCH_CLS").value

However, sometimes Access raises an 'Invalid Operation' error.
Adding a call to the WinAPI sleep helps, but it slows down the form
unnecessarily and the correct amount of milliseconds to sleep is
dependent on the machine.
I've also tried the DbEngine.Idle to no avail.

Any suggestions on how to tackle this?

Thanks,

Yves
Nov 12 '05 #1
3 5829
Yves wrote:
Hi,

I'm requering a combobox, and attempting to
a) force it to have the first item selected instead of no item
selected
b) use values in hidden columns of the combobox for the selected item

Currently the code looks like this:

'....
cmbBatches.Requery
If (cmbBatches.Recordset.RecordCount > 0) Then
cmbBatches.value = cmbBatches.Recordset.Fields(0).value
'...
something = cmbBatches.Recordset.Fields("BTCH_CLS").value

However, sometimes Access raises an 'Invalid Operation' error.
Adding a call to the WinAPI sleep helps, but it slows down the form
unnecessarily and the correct amount of milliseconds to sleep is
dependent on the machine.
I've also tried the DbEngine.Idle to no avail.

Any suggestions on how to tackle this?

Thanks,

Yves


Try a DoEvents after the Requery.

--
MGFoster:::mgf
Oakland, CA (USA)

Nov 12 '05 #2
MGFoster <me@privacy.com> wrote in message news:<qj******************@newsread2.news.pas.eart hlink.net>...
Yves wrote:
Try a DoEvents after the Requery.


Tried that, unfortunately does NOT work.

Any other suggestions?

Thanks
Nov 12 '05 #3
DFS

"Yves" <go**********@ygoetgeluck.mailshell.com> wrote in message
news:17**************************@posting.google.c om...
Hi,

I'm requering a combobox, and attempting to
a) force it to have the first item selected instead of no item
selected
Me.Combo.Requery
If Me.Combo.ListCount > 0 Then Me.Combo = Me.Combo.ItemData(0)

b) use values in hidden columns of the combobox for the selected item
If Me.Combo.ListCount > 0 Then variable = Me.Combo.Column(column, row)


Currently the code looks like this:

'....
cmbBatches.Requery
If (cmbBatches.Recordset.RecordCount > 0) Then
cmbBatches.value = cmbBatches.Recordset.Fields(0).value
'...
something = cmbBatches.Recordset.Fields("BTCH_CLS").value

However, sometimes Access raises an 'Invalid Operation' error.
Adding a call to the WinAPI sleep helps, but it slows down the form
unnecessarily and the correct amount of milliseconds to sleep is
dependent on the machine.
I've also tried the DbEngine.Idle to no avail.

Any suggestions on how to tackle this?

Thanks,

Yves

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pete | last post by:
I have a combobox which is used to select records, which is satisfactory at the moment. However, a second user is going to start using this database and there will be 1600 records. This makes...
0
by: luci | last post by:
Hello I've developed several data access pages and I searched for the same problems in different internet pages but I never got back a usable answer. Here are my questions: 1) How is it...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
6
by: Gil | last post by:
Hello, I want a combox to requery each time it is being changed. What i am trying to do is have the combo box filter to the text being entered. The combo1 rowsource is: SELECT * FROM tbl WHERE...
5
by: ApexData | last post by:
I have a ComboBox, when dblClicked, displays the combobox's row content in a continuous subform. Changes can be made to this content in the subform and then closed. The ComboBox needs to be...
3
by: ApexData | last post by:
COMBOBOX REFRESH DILEMMA ' I have been working for hours trying to figure out how to requery a combobox in a subform, from a Popup form ' that this subform had launched. Basically, I designed...
34
by: bitsnbytes64 | last post by:
Hi, I've been having a similar issue to what is described in the "refresh a form" post with a ComboBox that is not being refreshed after adding a new value on a seperate form. The second form is...
4
by: Luke Bailey | last post by:
I'm trying to complete some changes to a database that I have created and I need to finish it by tomorrow morning! Here's the situation: I have a form where people can order a number of...
4
by: EManning | last post by:
I have a combobox whose rowsource is a union query. This query displays a person's name in "lastname, firstname" format and in "firstname lastname" format. The query results look like this: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.