473,395 Members | 1,653 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,395 software developers and data experts.

combo box failure

i have a table with a yes/no field call "Edited". i have a button that
runs code to set the "Edited" field of a selected record to "yes". the
code also set the rowsource (using SQL Update and Set statement) of a
combo box to display only records with the "Edited" field = "No". the
button and the combo box are on the same form. the record is selected
from the combo box.

when i step through the code in debug mode, the combo box nicely
displays correctly only records with the "Edited" field = "No". which
could mean nothing wrong with the code? but when i click the button in
open form mode and open the combo box, the combo box displays both the
record with the "Edited" field = Yes and records with "Edited" field =
No. for the record where the "Edited" field has been set to "Yes", the
"edited" field displayed in the combo box shows a "No". the "Edited"
field change to a "Yes" only after i open the combo box twice. the
record with the "Edited" field = "Yes" disappears from the combo box
only after i have set another record's "Edited" field to "yes". this
does not happen all the time though.

what have i done wrong? what is the right way to do it so that the
combo box correctly display only records where "Edited" field ="No" at
all times?

thanks for your help.

Apr 8 '08 #1
2 1634
fr*****@gmail.com wrote:
i have a table with a yes/no field call "Edited". i have a button that
runs code to set the "Edited" field of a selected record to "yes". the
code also set the rowsource (using SQL Update and Set statement) of a
combo box to display only records with the "Edited" field = "No". the
button and the combo box are on the same form. the record is selected
from the combo box.

when i step through the code in debug mode, the combo box nicely
displays correctly only records with the "Edited" field = "No". which
could mean nothing wrong with the code? but when i click the button in
open form mode and open the combo box, the combo box displays both the
record with the "Edited" field = Yes and records with "Edited" field =
No. for the record where the "Edited" field has been set to "Yes", the
"edited" field displayed in the combo box shows a "No". the "Edited"
field change to a "Yes" only after i open the combo box twice. the
record with the "Edited" field = "Yes" disappears from the combo box
only after i have set another record's "Edited" field to "yes". this
does not happen all the time though.

what have i done wrong? what is the right way to do it so that the
combo box correctly display only records where "Edited" field ="No" at
all times?

thanks for your help.
I don't know what the combo has to do with displaying records with the
value set to No or Yes.

If you want to see records with Edited set to no you can have the
recordsource do it for you
Select * from Table1 where edited = False
or set the filter programatically.
Me.Filter = "Edited = False"
Me.FilterOn = True

I could have a combo with 3 options; Not Edited, Edited, ShowAll.
In the combo's AfterUpdate event I could do this
Dim strF As String
Select Case Me.ComboBoxName
Case "Not Edited"
strF = "Edited = False"
Case "Edited"
strF = "Edited = True
End Select
Me.Filter = strF
Me.FilterOn = (strF "") 'ShowAll would be ""

BeYourself
http://www.youtube.com/watch?v=xzNYfMTWpVs


Apr 8 '08 #2
The very strong possiblity is that the code does not wait for the update of
the "Edited" Field in the Table to be completed, before resetting the
RowSource of the Combo (and Requerying the Combo?). In debug mode, stepping
through at the speed of the human interface (you), you delay the resetting
of the Combo enough that the update has already completed.

I am a little puzzled at your comment about "(using SQL Update and Set
statement)" in regards to setting the RowSource... my usual Row Source is
either a text Value List, or the text of an SQL Statement, or the text name
of a saved Query... so I'm not sure what you are trying to do.

If you'll post the code... (I think the astrological configuration is not at
its best just now, because our psychic powers to "divine" what code you have
are at a low ebb)... perhaps someone can offer you a suggestion on what to
do.

Larry Linson
Microsoft Access MVP

<fr*****@gmail.comwrote in message
news:98**********************************@q10g2000 prf.googlegroups.com...
>i have a table with a yes/no field call "Edited". i have a button that
runs code to set the "Edited" field of a selected record to "yes". the
code also set the rowsource (using SQL Update and Set statement) of a
combo box to display only records with the "Edited" field = "No". the
button and the combo box are on the same form. the record is selected
from the combo box.

when i step through the code in debug mode, the combo box nicely
displays correctly only records with the "Edited" field = "No". which
could mean nothing wrong with the code? but when i click the button in
open form mode and open the combo box, the combo box displays both the
record with the "Edited" field = Yes and records with "Edited" field =
No. for the record where the "Edited" field has been set to "Yes", the
"edited" field displayed in the combo box shows a "No". the "Edited"
field change to a "Yes" only after i open the combo box twice. the
record with the "Edited" field = "Yes" disappears from the combo box
only after i have set another record's "Edited" field to "yes". this
does not happen all the time though.

what have i done wrong? what is the right way to do it so that the
combo box correctly display only records where "Edited" field ="No" at
all times?

thanks for your help.

Apr 8 '08 #3

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

Similar topics

3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
4
by: Heather | last post by:
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...
0
by: zlib101892NoSpam | last post by:
Error: failure of the list portion of a combo box to remain visible The error appears to be due to code in a conditional statement that set the ControlTipText property of the combo box to...
1
by: Ray | last post by:
To select all, I leave the combo box blank and press Enter. In my query for my criteria I use like Forms!! &"*" It does not work when I open the form. I need to press the space bar or...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
2
by: kiranmn75 | last post by:
I want to dynamically populate a combo box through javascript. Data is coming from a array. Sometimes data list may contain items in excess of 2000. Explorer takes more than 5 seconds to...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
2
by: =?Utf-8?B?ZnJlZGR5?= | last post by:
I am new to the whole c# thing, I now how to get data from a db into a combo box. My question is: should I have one table for 5 combo box or have 5 tables for 5 combo box?
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.