Re: Newbie: How to extract year from a Date object
- From: "PC" <Onzin@xxxxxxxxxx>
- Date: Tue, 20 Sep 2005 19:18:32 +0200
you can use year,month,day in an enum
if you use the full syntax for the vba functions
example:
Private Enum enumDates
Year
Month
Day
End Enum
Private Sub Command1_Click()
Print VBA.Year(Now), VBA.Month(Now), VBA.Day(Now)
Print Year, Month, Day
End Sub
"Someone" <nobody@xxxxxxx> wrote in message
news:eMXXe.44114$ct5.9164@xxxxxxxxxxxxx
> I just found out that if you use "Year" as an item in Enum, it will not
> work. It would give you a compile time error.
>
> Example:
>
> Private Enum enumDates
> Year
> Month
> Day
> End Enum
>
> This will override Year(), Month(), and Day() functions since they are
part
> of VBA library, which is part of VB6.
>
> To avoid these problems, I always prefix Enum elements with "enm" or
"enum".
> Most likely I would write it like this:
>
> Private Enum enumDates
> enmDateYear
> enmDateMonth
> enmDateDay
> End Enum
>
.
- References:
- Re: Newbie: How to extract year from a Date object
- From: Someone
- Re: Newbie: How to extract year from a Date object
- From: Someone
- Re: Newbie: How to extract year from a Date object
- Prev by Date: Database and report question
- Next by Date: Re: Out of Memory Problem in VB 6.0 Application.
- Previous by thread: Re: Newbie: How to extract year from a Date object
- Next by thread: Re: Newbie: How to extract year from a Date object
- Index(es):