473,659 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List Box gives Null Values

I have a list box that is generated on a form by way of a
Parameter Query. Problem is whenever I try to refer to the list
box, i.e., to update the underlying table, I am getting a "null"
value from any row or field I refer to. Have tried using "after
update" events as well as a button click event to no avail. The
debug window always shows "null" values when I bring it up while
trying to examine my code\events. Is there a way to get back to
the underlying table\query from a list box created via a
parameter query??
If I need to clarify this a bit more let me know & I will try
to. Am only a casual user of access but seems to me that what I
am trying to do should be fairly straightforward . Has me
dumbfounded however.
Thanks for any help,
dc
Feb 24 '06 #1
6 5936
How many columns are in the listbox? Which column is the Bound Column? The
listbox's Value will come from the Bound Column for the selected row.

What is the MultiSelect property (Other tab) of the listbox set at? If it is
at None, then you can only select one row at a time and the above statement
is true. If it is set to Simple or Extended, then you can select more than
one row at a time. The problem is that the listbox can have only one
"value", so getting the value of the listbox when it is set to allow
multiple selections doesn't work. Instead, you have to loop through the
ItemsSelected collection of the list box and get the value of each selected
row. The help file has a very good example of doing this. Search help on the
term ItemsSelected.

--
Wayne Morgan
MS Access MVP
"doncee" <no************ *****@charter.n et> wrote in message
news:Xn******** *************** **@216.196.97.1 31...
I have a list box that is generated on a form by way of a
Parameter Query. Problem is whenever I try to refer to the list
box, i.e., to update the underlying table, I am getting a "null"
value from any row or field I refer to. Have tried using "after
update" events as well as a button click event to no avail. The
debug window always shows "null" values when I bring it up while
trying to examine my code\events. Is there a way to get back to
the underlying table\query from a list box created via a
parameter query??
If I need to clarify this a bit more let me know & I will try
to. Am only a casual user of access but seems to me that what I
am trying to do should be fairly straightforward . Has me
dumbfounded however.
Thanks for any help,
dc

Feb 24 '06 #2
Thanks for the reply. I only have 3 columns & the bound column
is the first one. I am not set for multiselect , shows "none" in
the other property list and am only intersted in one row at a
time right now. I have read the help file but am sure I am
missing something. I have had success in the past with combo
boxes but that will not work for this app. Thanks for the info.
dc

How many columns are in the listbox? Which column is the
Bound Column? The listbox's Value will come from the Bound
Column for the selected row.

What is the MultiSelect property (Other tab) of the listbox
set at? If it is at None, then you can only select one row
at a time and the above statement is true. If it is set to
Simple or Extended, then you can select more than one row
at a time. The problem is that the listbox can have only
one "value", so getting the value of the listbox when it is
set to allow multiple selections doesn't work. Instead, you
have to loop through the ItemsSelected collection of the
list box and get the value of each selected row. The help
file has a very good example of doing this. Search help on
the term ItemsSelected.


Feb 24 '06 #3
How are you referring to the listbox? Are you referring to it in code, in a
query, or in another control? What is the statement you are using where you
refer to it?

--
Wayne Morgan
MS Access MVP
"doncee" <no************ *****@charter.n et> wrote in message
news:Xn******** *************** *@216.196.97.13 1...
Thanks for the reply. I only have 3 columns & the bound column
is the first one. I am not set for multiselect , shows "none" in
the other property list and am only intersted in one row at a
time right now. I have read the help file but am sure I am
missing something. I have had success in the past with combo
boxes but that will not work for this app.

Feb 24 '06 #4
Thanks again for the reply. This is the " after update" code
that I have used but get an error that no records available:
-> Me.RecordsetClo ne.FindFirst "[memberID] = " & Me![List9]<--
The memberid is an expression field from the original query
underlying the parameter query I use to create the list box.
I have also tried the following as a click event on a
button but also get a null when check the value of the
[memberid] expression:
Dim db As Database
Set db = CurrentDb
Dim stDocName As String
Set rst = db.OpenRecordse t("query3", dbOpenDynaset)
Me.Bookmark = Me.RecordsetClo ne.Bookmark
Debug.Print [MEMBERID]

The above gets me a Null in the immediate pane of the debug
window & of course no records found.
Does any of this make sense? I'm sure I've got something
ass-backwards but it seems I have used these codes before with
success. It seems as if I am losing my reference to the original
query after I create the list box from the parameter query.
Thanks again for your reply
dc
How are you referring to the listbox? Are you referring to
it in code, in a query, or in another control? What is the
statement you are using where you refer to it?


Feb 24 '06 #5
Do a

Debug.Print Me!List9

before the "Me.RecordsetCl one.FindFirst.. ." and see what that gives you.

--
Wayne Morgan
MS Access MVP
"doncee" <no************ *****@charter.n et> wrote in message
news:Xn******** *************** **@216.196.97.1 31...
Thanks again for the reply. This is the " after update" code
that I have used but get an error that no records available:
-> Me.RecordsetClo ne.FindFirst "[memberID] = " & Me![List9]<--
The memberid is an expression field from the original query
underlying the parameter query I use to create the list box.
I have also tried the following as a click event on a
button but also get a null when check the value of the
[memberid] expression:
Dim db As Database
Set db = CurrentDb
Dim stDocName As String
Set rst = db.OpenRecordse t("query3", dbOpenDynaset)
Me.Bookmark = Me.RecordsetClo ne.Bookmark
Debug.Print [MEMBERID]

The above gets me a Null in the immediate pane of the debug
window & of course no records found.
Does any of this make sense? I'm sure I've got something
ass-backwards but it seems I have used these codes before with
success. It seems as if I am losing my reference to the original
query after I create the list box from the parameter query.
Thanks again for your reply
dc
How are you referring to the listbox? Are you referring to
it in code, in a query, or in another control? What is the
statement you are using where you refer to it?

Feb 26 '06 #6
Thanks again for your reply. I changed the bound column around
on the underlying table\query & all seems fine right now. Not
sure what was wrong with the bound column I was using but am now
finally able to access the records from the list box.
Thanks again
dc
"Wayne Morgan" <co************ *************** @hotmail.com>
wrote in
news:OA******** **********@news svr13.news.prod igy.com:
Do a

Debug.Print Me!List9

before the "Me.RecordsetCl one.FindFirst.. ." and see what
that gives you.


Feb 26 '06 #7

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

Similar topics

0
935
by: Maurice | last post by:
how could you pass the head from a linked list class so that it could be used in a main file? here is the content of the linkedlist.h file: #ifndef LINKEDLIST_H #define LINKEDLIST_H //******************************************************************
7
1983
by: chand | last post by:
Hi., In my api.py file 'g_opt_list' is defined globally g_opt_list =,,,,,,] I am using this global list in the fucntion def function (): gloabl g_opt_list
5
4126
by: William Wisnieski | last post by:
Hello Everyone, I have a query by form with several list boxes. The user selects items from the list boxes and clicks a button that returns results in a datasheet subform. One of the list boxes contains two values: Call Back and No Answer. The user can select either one or both and the proper results are returned. If the user doesn't use this list box, then all Call Backs, No Answers, and Null values are returned. As another...
5
2390
by: Little | last post by:
I have this program and I need to work on the test portion, which tests if a Val is in the list. It returns false no matter what could you look at the part and see what might need to be done to fix it. It reads in the file and sorts out the files into the four different lists. F.txt int main 2 " " help
2
9949
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
15
7719
RMWChaos
by: RMWChaos | last post by:
As usual, an overly-long, overly-explanatory post. Better too much info than too little, right? A couple weeks ago, I asked for some assistance iterating through a JSON property list so that my code would either select the next value in the member list or the single value. The original post can be found here. This is the code gits helped me write: for (var i = 0; i < attribList.id.length; i++) { var attrib = {};
0
8624
by: Atos | last post by:
SINGLE-LINKED LIST Let's start with the simplest kind of linked list : the single-linked list which only has one link per node. That node except from the data it contains, which might be anything from a short integer value to a complex struct type, also has a pointer to the next node in the single-linked list. That pointer will be NULL if the end of the single-linked list is encountered. The single-linked list travels only one...
36
2887
by: pereges | last post by:
Hi, I am wondering which of the two data structures (link list or array) would be better in my situation. I have to create a list of rays for my ray tracing program. the data structure of ray looks like this: typedef struct { vector origin; /* vector is an array of 3 doubles */
12
4030
by: kalyan | last post by:
Hi, I am using Linux + SysV Shared memory (sorry, but my question is all about offset + pointers and not about linux/IPC) and hence use offset's instead on pointers to store the linked list in the shared memory. I run fedora 9 and gcc 4.2. I am able to insert values in to the list, remove values from the list, but the problem is in traversing the list. Atlease one or 2 list nodes disappear when traversing from the base of the list or...
0
8341
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
8851
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...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8630
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
7360
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
6181
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
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2759
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
1982
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.