LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Setting date format for list box

I am retrieving data into a list box from an Access database with,
essentially, the following code

:
Dim dbReports As DAO.Recordset
Dim avRows As Variant
:
Set dbReports = gdbEmissions.OpenRecordset(sQuery)

'update list box
With Me.lbxSite
.Clear
If dbReports.RecordCount 0 Then
avRows = dbReports.GetRows(mlNumRecords)
.List = Application.WorksheetFunction.Transpose(avRows)
End If
.ListIndex = -1
End With
:

Five columns of data are shown, including one column that contains date data.

Everything is fine EXCEPT that the date format is dependent upon how the
display form is run.
If I start with a front-end form that calls the display form, then the date
format is MM/DD/YYYY, contrary to the regional setting
If I start the display form from within the VBA environment then the date
format is DD/MM/YYYY - which is the desired format, and also the regional
setting

Why is there a difference, and can I force Excel to use the regional setting ?

Regards
Kevin Beckham
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the date format Boris Excel Discussion (Misc queries) 3 November 18th 08 12:55 PM
Date format in permanent list kayabob Excel Discussion (Misc queries) 1 October 14th 06 09:35 AM
How keep date format from excel to merged list Cyrus New Users to Excel 5 March 28th 06 06:44 PM
How do I create list validation from code without the text being converted into date format? EG[_3_] Excel Programming 2 November 24th 05 10:16 AM
VBA Setting .Value to a date does not respect local system setting Frank_Hamersley Excel Programming 13 July 18th 04 02:51 PM


All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"