fields join

G

golan

hello;i have 2 comobox month and year. i want to join the to one field after
the user choose.
 
G

golan

thanks , if i want to to define variable as date in format mm yy how i can do
it?
thanks again
 
K

Ken Sheridan

Why join them at all? If you have two fields, YearField and MonthField say
you can always join them in an expression in a query or in code, or in the
ControlSource of a computed control in a form or report. The combo boxes can
then simply be bound to the fields. Having them as separate fields will make
things easier in many ways.

BTW Steve's SetFucus method is one of his own invention, the purpose of
which I would prefer not to contemplate! He meant SetFocus.

Ken Sheridan
Stafford, England
 
K

Ken Sheridan

Provided the YearField value is a four digit one you can use:

=Format(YearField & "-" & MonthField, "mm yy")

Omitting a day of the month assumes the first of the month, but bear in mind
that this returns not a value of date/time data type, but a string
expression. In fact you can't have a date/time value of limited precision.
Even without any time of day being entered this assumes a time of day of
zero, i.e. midnight at the start of the day. You can see this yourself if
you use:

=Format(YearField & "-" & MonthField, "yyyy-mm-dd hh:nn:ss")

Ken Sheridan
Stafford, England
 
J

John... Visio MVP

Steve said:
<BTW Steve's SetFucus method is one of his own invention ............ >

I plagarized this line of code from John Marshall, MVP Visio :)

Steve

You still like to lie. I'm still waiting for an apology for the libelous
accusations you made the other day.

At least you freely admit to the fact that you do plagarize. So before you
forget, these newwsgroups are provided by Microsoft for FREE peer to peer
support.

John...
 
Top