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?
MGFoster - 12 Feb 2005 02:12 GMT
Since the column PRSTUDY_ID is a char column, you have to delimit the
value in quotes:
"WHERE [KSTUDY_KSTUDY].[PRSTUDY_ID] = '" & Me!List0 & "'"

Signature
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
> Why doesn't this code work:
> -------------------------code snippet-----------------
[quoted text clipped - 24 lines]
>
> Any ideas?
Rexxx - 12 Feb 2005 03:21 GMT
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!
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
[quoted text clipped - 32 lines]
>>
>> Any ideas?