ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array by getrows to listbox - date format problem (https://www.excelbanter.com/excel-programming/443372-array-getrows-listbox-date-format-problem.html)

kalle

Array by getrows to listbox - date format problem
 
Hi Group,

As a newbie I try to develop a form where the user can build a SQL-
query. By browsing this group I have
learnt a lot. The result of the user built query is a recordset with 1
to 9 fields. One or more fields has date
formats like "yyyy-mm-dd". As the fields, depending on the users
choice, may be in different order I use the
Getrows method to get an array for passing to a listbox. The trouble
is that the date fields shows up in the
listbox with the format "mm/dd/yyyy". I now that this problem may be
solved by passing the array by additem
method to the listbox. But is there a way to change the format of the
dates and still using the getrows method.
The code below is used to pass the array to the listbox.

Some hints would be valuable.

Brgds

CG Rosen

---------------------------------------------------------------------------------------------------------------
rsData.Open szSQL, ConnString, adOpenKeyset

rcArray = rsData.GetRows

With UserForm1.ListBox1
..Clear
..ColumnCount = -1
..Column = rcArray
..ListIndex = -1
End With


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com