-----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?