473,788 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1666
fr*****@gmail.c om 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******** *************** ***********@q10 g2000prf.google groups.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
4319
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
4282
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 Agency Types, then the 2nd combo box displays a list of Organisations, depending upon the Agency Type Selected. The first combo box 'ctlType' (Unbound), Row Source: to field in 'AgencyReferralType'.
0
1175
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 different values depending on whether the conditional evaluated as true or false. The code occurs in the MouseMove event of the affected combo box. For example: Private Sub CtlComboBox_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As...
1
1534
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 select on item from the box and delete it before I press Enter to make it workable. Can someone advise what is possible cause for the first time failure to work.
3
3656
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" through "Phase 10" (there are 10 Phases I want to sort from) Once the phase has been selected a second combo box would populate.
2
2452
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 populate the combo (for a list of 2500). Can anybody optimize the code. I tried Duffs devise instead of 'for loop', but no improvement.
6
3683
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
2028
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
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.