473,811 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listbox Updating

Why doesn't this code work:
-------------------------code snippet-----------------
Dim categorysource As String

categorysource = "SELECT [KSTUDY_KSTUDY].[KSTUDY_ID],
[KSTUDY_KSTUDY].[KSTUDY_CATEGORY], [KSTUDY_KSTUDY].[KSTUDY_WHO]" & _
" FROM KSTUDY_KSTUDY " & _
" WHERE [KSTUDY_KSTUDY].[PRSTUDY_ID] = " & Me.List0.Value

Me.List4.RowSou rce = categorysource
Me.List4.Requer y
-------------------------code snippet--------------------

I put this as an afterupdate event. Basically, I have two listboxes.
LIST0 has a list of records from the KSTUDY_PRSTUDY table. There are
only 2 fields in this table. PRSTUDY_ID and CATEGORY. I display
Category, but hide the PRSTUDY_ID. PRSTUDY_ID, however, is the key
column, and is also the bound column. So, when I select one of the
categories, the value of P101, P102, etc is selected. All well and
good.

I put the above code in the AFTERUPDATE event of LIST0. Unfortunately,
it does appear to be updating the rowsource of LIST4 properly.. but I
can't, for the life of me, make it update the listbox and display
anything. It just sits there empty.

Any ideas?

Nov 13 '05 #1
2 1670
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Since the column PRSTUDY_ID is a char column, you have to delimit the
value in quotes:

"WHERE [KSTUDY_KSTUDY].[PRSTUDY_ID] = '" & Me!List0 & "'"

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQg1mB4echKq OuFEgEQKb4ACePh Rkp7OsD7VbXwWW0 t808l995LoAn086
j5YdWkPxobekfYu 1+rbUEFMD
=Pu9U
-----END PGP SIGNATURE-----
Basic wrote:
Why doesn't this code work:
-------------------------code snippet-----------------
Dim categorysource As String

categorysource = "SELECT [KSTUDY_KSTUDY].[KSTUDY_ID],
[KSTUDY_KSTUDY].[KSTUDY_CATEGORY], [KSTUDY_KSTUDY].[KSTUDY_WHO]" & _
" FROM KSTUDY_KSTUDY " & _
" WHERE [KSTUDY_KSTUDY].[PRSTUDY_ID] = " & Me.List0.Value

Me.List4.RowSou rce = categorysource
Me.List4.Requer y
-------------------------code snippet--------------------

I put this as an afterupdate event. Basically, I have two listboxes.
LIST0 has a list of records from the KSTUDY_PRSTUDY table. There are
only 2 fields in this table. PRSTUDY_ID and CATEGORY. I display
Category, but hide the PRSTUDY_ID. PRSTUDY_ID, however, is the key
column, and is also the bound column. So, when I select one of the
categories, the value of P101, P102, etc is selected. All well and
good.

I put the above code in the AFTERUPDATE event of LIST0. Unfortunately,
it does appear to be updating the rowsource of LIST4 properly.. but I
can't, for the life of me, make it update the listbox and display
anything. It just sits there empty.

Any ideas?

Nov 13 '05 #2
I'm not at work now to try it out.. (the tables are actually linked Oracle
tables.. so I can't play with it at home..) but I will try it when I get to
work and see what happens. Thanks a TON!

"MGFoster" <me@privacy.com > wrote in message
news:dC******** *********@newsr ead3.news.pas.e arthlink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Since the column PRSTUDY_ID is a char column, you have to delimit the
value in quotes:

"WHERE [KSTUDY_KSTUDY].[PRSTUDY_ID] = '" & Me!List0 & "'"

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQg1mB4echKq OuFEgEQKb4ACePh Rkp7OsD7VbXwWW0 t808l995LoAn086
j5YdWkPxobekfYu 1+rbUEFMD
=Pu9U
-----END PGP SIGNATURE-----
Basic wrote:
Why doesn't this code work:
-------------------------code snippet-----------------
Dim categorysource As String

categorysource = "SELECT [KSTUDY_KSTUDY].[KSTUDY_ID],
[KSTUDY_KSTUDY].[KSTUDY_CATEGORY], [KSTUDY_KSTUDY].[KSTUDY_WHO]" & _
" FROM KSTUDY_KSTUDY " & _
" WHERE [KSTUDY_KSTUDY].[PRSTUDY_ID] = " & Me.List0.Value

Me.List4.RowSou rce = categorysource
Me.List4.Requer y
-------------------------code snippet--------------------

I put this as an afterupdate event. Basically, I have two listboxes.
LIST0 has a list of records from the KSTUDY_PRSTUDY table. There are
only 2 fields in this table. PRSTUDY_ID and CATEGORY. I display
Category, but hide the PRSTUDY_ID. PRSTUDY_ID, however, is the key
column, and is also the bound column. So, when I select one of the
categories, the value of P101, P102, etc is selected. All well and
good.

I put the above code in the AFTERUPDATE event of LIST0. Unfortunately,
it does appear to be updating the rowsource of LIST4 properly.. but I
can't, for the life of me, make it update the listbox and display
anything. It just sits there empty.

Any ideas?

Nov 13 '05 #3

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

Similar topics

5
3533
by: Bill | last post by:
I have have two list boxes. One is a listing of all possible variables. We'll call this listbox A. The other is a listing of all the selected variables. We'll call this listbox B. If a person double-clicks on one of the variables in listbox A it "moves" it to listbox B. What is going on behind the scenes is that the table that holds all these variables has a yes/no field call Print. When the user double clicks on the value it fires a...
3
9432
by: gdbjohnson-AT-yahoo-dot-ca-nospamplz | last post by:
I have a ListBox built of a simple custom object for the ListItems used to be able to hold a Data Value, and a Display Value, with accessors for each. I have overridden the ToString method to display the Display value. (Two examples that I have seen, including an MS example, suggest that the DisplayMember and ValueMember properties of the ListBox can be used in this way, I could not get it to work using the ListItems.Add method -...
1
2710
by: MrNobody | last post by:
Hi, I'm doing something where I add custom objects to a ListBox which have aToString() method overriden so it displays what I want. When adding instances of these custom objects to the ListBox I also put the same references in a Hashtable so my program can obtain and modify these objects without iterating through entire ListBox looking for what I want. The problem is though, when I update these objects the changes are not being reflected...
7
4540
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but ASP.Net stuff when I need a Windows Form control. I've seen dual listbox populators in countless Windows applications, and have seen them run very fast, so I figured this would be extremely popular. Here's how it should work:
1
3046
by: Spock | last post by:
Hi. I have a form with a listbox and a few label fields all bound to a dataset. When i navigate the listbox the labels change accordingly. so far everything works good. I made a button to delete a record. I delete the row from the datatable and update the database with the adapter and that all works good. The record is removed from the listbox. Here is my problem.
7
1914
by: samoore33 | last post by:
I am trying to dynamically add items to a listbox or combobox. The items add to either, but when I look through those items, there is nothing there. If I choose an item, it shows up. Not sure why, but the items are not visible in the listbox or combobox until one of the items has been chosen. This of course is not good, since someone can not see the items they need to choose from. Any help would be appreciated.
6
3966
by: Zytan | last post by:
In win32 there was a way to 'turn off' a listbox from updating until you were done adding elements. Is there a way to do this in .NET? Zytan
1
4034
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
1
8306
by: Refugnic | last post by:
I tried to fill a ListBox with a DataSource pointing to an ArrayList. It all works fine...up to one point. The ArrayList is dynamic, which means the contents of it change, during the course of program use. But instead of Updating the ListBox, virtually nothing happens. The items that were written into the ListBox during the first run remain inside the ListBox, assuming the new values of the ArrayList. Obviously, if the new ArrayList is...
3
2737
by: Reg Verrin | last post by:
I have a program that displays constantly changing prices which it sources from the web once per second. The prices are displayed on a Listbox (not the best choice but there are good reasons for this). The Listbox flickers when updating and I can't find a solution on the net. Here is the code: 'update Listbox
0
9730
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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
10651
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
10403
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
10136
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
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
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
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.