Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2005

Tip: Looking for answers? Try searching our database.

Listbox Updating

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Basic - 12 Feb 2005 00:10 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.