View Single Post
  #4  
Old August 18th, 2009, 10:22 PM posted to microsoft.public.access.reports
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default International dates

When I refer to a "wrapper function", I'm simply talking about a function
that has to be wrapped around a value or expression. The function itself
would exist in a module.

I'm curious as to why you couldn't open the database. It's in Access 97
format, and all current versions of Access should be able at least to open
it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Saylindara" wrote in message
...
Thank you for your reply.

I found Allen Browne's advice helpful when I working out queries involving
dates. I used CVDate then. The trouble is, being a numbskull, I only
understand very simple instructions. I couldn't open the database on your
link but I've studied the pdf. I don't know what a wrapper is. Is it the
same
as a module? The SQLDate thingy looks just the ticket if I can use it to
open
the report. Will it mean that the users can put in the date in the British
format in the text box on the unbound parameter form and all will be OK?

"Douglas J. Steele" wrote:

Check Allen Browne's "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003
Access
Answers column for Pinnacle Publication's "Smart Access" newsletter. (The
column and accompanying database can be downloaded for free at
http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Saylindara" wrote in message
...
I have set up a parameter form to open a report.
I originally set up two textboxes - a DateFrom and DateTo. The format
for
these is dd mm yyyy. Unfortunately the report opens as though I had
requested
the dates in the American format mm dd yyyy, e.g. a date requested from
3rd
April opened a report from 4th March. Short date or long date it didn't
make
any difference.

The instructions for using a calendar said that this would solve the
problem
but it didn't. I also tried a module for converting the date to the US
format, Format() and CVDate, but nothing worked.

The codes I used to open the report and the calendar are as follows:

On Click Event of the command button to open the report

Private Sub Command10_Click()
Refresh
If IsNull(cboFindEvent) Then
DoCmd.OpenReport "r_EventsAttendedByEvent", acViewPreview, , "EventDate
=
#" & Me.cboEventFromDate & " # AND " & "EventDate = #" &
Me.cboEventToDate &
"#"
Else
DoCmd.OpenReport "r_EventsAttendedByEvent", acViewPreview, , "EventID
=" &
Me.cboFindEvent & " AND " & "EventDate = #" & Me.cboEventFromDate & "
#
AND
" & "EventDate = #" & Me.cboEventToDate & "#"
End If
End Sub

The Calendar

The selection boxes for the calendar are comboboxes so people know they
have
to click on them. The calendar pops up and then once the date is
selected
it
disappears.

Private Sub cboEventToDate_MouseDown(Button As Integer, Shift As
Integer,
x
As Single, Y As Single)
Refresh
ocxCalendarEventTo.Visible = True
ocxCalendarEventTo.SetFocus
If Not IsNull(cboEventToDate) Then
ocxCalendarEventTo.Value = cboEventToDate
Else
ocxCalendarEventTo.Value = Date
End If
End Sub

And

Private Sub ocxCalendarEventTo_Click()
cboEventToDate = ocxCalendarEventTo.Value
cboEventToDate.SetFocus
ocxCalendarEventTo.Visible = False
End Sub

Any help gratefully received.