Re: Lebans Calendar code problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This line:

> Dim dteFrom, dteTo As Date

....will be interpreted as dteFrom as Variant.
It is best to declare each variable independently
to avoid confusion.

Change your code to this:

Private Sub butSetTarget_DblClick(Cancel As Integer)
' Uses Calendar Window
Dim dteFrom As Date, dteTo As Date
dteFrom = Date
dteTo = 0
If ShowMonthCalendar(mc, dteFrom, dteTo) Then
MsgBox dteFrom
End If
End Sub

--
Jeff Conrad
Access Junkie
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

"mscertified" wrote in message:
news:3004F725-67A6-4B27-8577-16BDEB86131F@xxxxxxxxxxxxxxxx

> I'm attempting to use the API Calendar from Mr Leban's site
> Below is my execution code, I get a "By Ref Argument error" on the 2nd parm
> of the function call. I followed the instructions exactly. Any ideas?
>
> Private Sub butSetTarget_DblClick(Cancel As Integer)
> ' Uses Calendar Window
> Dim dteFrom, dteTo As Date
> dteFrom = Date
> dteTo = 0
> If ShowMonthCalendar(mc, dteFrom, dteTo) Then
> MsgBox dteFrom
> End If
> End Sub


.



Relevant Pages

  • Re: Lebans Calendar code problem
    ... only dteTo will be created as a Date. ... Dim dteFrom As Date ... > Private Sub butSetTarget_DblClick ...
    (microsoft.public.access.forms)
  • Lebans Calendar code problem
    ... I'm attempting to use the API Calendar from Mr Leban's site ... Private Sub butSetTarget_DblClick ... Dim dteFrom, dteTo As Date ...
    (microsoft.public.access.forms)
  • Re: Lebans Calendar code problem
    ... "Brendan Reynolds" wrote: ... only dteTo will be created as a Date. ... > Dim dteFrom As Date ... >> Dim dteFrom, dteTo As Date ...
    (microsoft.public.access.forms)
  • Data type mismatch in criteria expression
    ... I get the error "Data type mismatch in criteria expression. ... ReleaseAmount, TagNo, ProductNo, WarehouseID, DateOut, FromStock, ... Between:dteFrom And:dteTo)); ... var dteFrom, dteTo: TDate; ...
    (borland.public.delphi.database.ado)
  • Re: need help with inserting a set of records
    ... tblDates with field Ddate inserted starting from txtDateFr and adding ... Dim db As DAO.Database ... Dim dteFrom As Date ... Dim dteTo As Date ...
    (comp.databases.ms-access)