By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,963 Members | 1,749 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,963 IT Pros & Developers. It's quick & easy.

Listbox Updating

P: n/a
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.RowSource = categorysource
Me.List4.Requery
-------------------------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
Share this Question
Share on Google+
2 Replies


P: n/a
-----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:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQg1mB4echKqOuFEgEQKb4ACePhRkp7OsD7VbXwWW0t808l 995LoAn086
j5YdWkPxobekfYu1+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.RowSource = categorysource
Me.List4.Requery
-------------------------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

P: n/a
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*****************@newsread3.news.pas.earthl ink.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:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQg1mB4echKqOuFEgEQKb4ACePhRkp7OsD7VbXwWW0t808l 995LoAn086
j5YdWkPxobekfYu1+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.RowSource = categorysource
Me.List4.Requery
-------------------------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 discussion thread is closed

Replies have been disabled for this discussion.