The simplest thing that works is the best -- especially a few years from
now when somebody else is trying to make sense of what you did!

Tobi

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Databasedude.com
Sent: Thursday, December 08, 2005 12:58 PM
To: [email protected]
Subject: [AccessDevelopers] Re: Field order reversed in listbox


It does work with the SQL string as the source ... I'm just wondering
why it wouldn't work as I've written it and where it's breaking down in
the code and my understanding.

Seems to work fine if I create an ADO recordset from XML.

Not gonna hurt if I don't find out besides now satisfying curiosity  :)

Thanks for your help!
Bryant

--- In [email protected], "Hoffman, Tobi K \(DYS\)"
<[EMAIL PROTECTED]> wrote:
>
> How about simply taking that SQL string and making it the Listbox 
> source?  Are you going to more trouble than you need?
> 
> Tobi
> 
> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Databasedude.com
> Sent: Thursday, December 08, 2005 12:45 PM
> To: [email protected]
> Subject: [AccessDevelopers] Re: Field order reversed in listbox
> 
> 
> Let me put in my full process & code, and maybe that will help you to 
> understand better.
> 
> I created an ADO recordset (rst), using a SQL string that selects 
> TenantDisplayName and TenantDisplayName (in that order), and then set 
> the source of the listbox to it as below:
> 
>      Set lstListbox.Recordset = rst
> 
> The listbox control has Row Source Type set to Table/Query, Row Source

> as blank (since I'm not assigning the SQL code to the listbox), Column

> Count as 2, Bound Column as 1.
> 
> That does produce items in the listbox, with rows in the proper order 
> ... but with columns out of sequence.
> 
> I apologize if I was unclear previous about how I was going about 
> things.
> 
> Bryant
> 
> 
> 
> 
> --- In [email protected], "Hoffman, Tobi K \(DYS\)" 
> <[EMAIL PROTECTED]> wrote:
> >
> > Ah, it's the column order (your row sort was different in the two
> > examples as well) -- look at the listbox Row Source and rearrange
the 
> > column order there.  Click on the .. at the far right of the Row 
> > Source line in Properties; it will look like a query, and you can do

> > the rearranging there.
> > 
> > Tobi
> > 
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[EMAIL PROTECTED] On Behalf Of 
> > Databasedude.com
> > Sent: Thursday, December 08, 2005 11:34 AM
> > To: [email protected]
> > Subject: [AccessDevelopers] Re: Field order reversed in listbox
> > 
> > 
> > Wouldn't Order By address how the rows are sorted, not how the 
> > columns
> 
> > appear left-to-right?
> > 
> > Bryant
> > 
> > --- In [email protected], "Hoffman, Tobi K \(DYS\)"
> > <[EMAIL PROTECTED]> wrote:
> > >
> > > You need to fill in the Order By line in the Properties for the 
> > > listbox, and/or add an "ORDER BY" clause in the query.  The 
> > > listbox "Order By" will take precedence over the query order.
> > > 
> > > Tobi
> > > 
> > > 
> > > -----Original Message-----
> > > From: [email protected] 
> > > [mailto:[EMAIL PROTECTED] On Behalf Of 
> > > Databasedude.com
> > > Sent: Thursday, December 08, 2005 9:48 AM
> > > To: [email protected]
> > > Subject: [AccessDevelopers] Field order reversed in listbox
> > > 
> > > 
> > > I am creating an ADO recordset and assigning it as the source of a

> > > listbox. However, the column order in the listbox is different 
> > > from the query.
> > > 
> > > Here is the SQL statement:
> > > 
> > >     strSQL = "SELECT [TenantID], [TenantDisplayName] " _
> > >         & "FROM qselTenantList_Temp " _
> > >         & "WHERE TenantID = TenantID "
> > > 
> > > That produces this result:
> > > 
> > > TenantID     TenantDisplayName
> > > --------     -----------------
> > > ABC          The ABC Corporation
> > > 123          Lotus Company
> > > 
> > > 
> > > In the listbox, TenantDisplayName appears, followed by TenantID.
> > > 
> > > TenantDisplayname     TenantID
> > > -----------------     --------
> > > The ABC Corporation   ABC
> > > Lotus Company         123
> > > 
> > > Any ideas why it would switch column order?
> > > 
> > > Thanks in advance,
> > > Bryant
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Please zip all files prior to uploading to Files section. Yahoo!
> > > Groups Links
> > >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Please zip all files prior to uploading to Files section. Yahoo! 
> > Groups Links
> >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Please zip all files prior to uploading to Files section.
> Yahoo! Groups Links
>








Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/u8TY5A/tzNLAA/yQLSAA/q7folB/TM
--------------------------------------------------------------------~-> 


Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to