473,508 Members | 2,392 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 5904
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.net> wrote in message
news:Xn*************************@216.196.97.131...
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.net> wrote in message
news:Xn************************@216.196.97.131...
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.RecordsetClone.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.OpenRecordset("query3", dbOpenDynaset)
Me.Bookmark = Me.RecordsetClone.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.RecordsetClone.FindFirst..." and see what that gives you.

--
Wayne Morgan
MS Access MVP
"doncee" <no*****************@charter.net> wrote in message
news:Xn*************************@216.196.97.131...
Thanks again for the reply. This is the " after update" code
that I have used but get an error that no records available:
-> Me.RecordsetClone.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.OpenRecordset("query3", dbOpenDynaset)
Me.Bookmark = Me.RecordsetClone.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******************@newssvr13.news.prodigy.c om:
Do a

Debug.Print Me!List9

before the "Me.RecordsetClone.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
1980
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
4119
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...
5
2374
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...
2
9937
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
7711
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...
0
8611
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...
36
2860
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...
12
3998
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...
0
7224
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
7120
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
7323
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
4706
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...
0
3192
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...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
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 ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
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...

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.