Concatenate on a form

  • Thread starter Thread starter Jim L.
  • Start date Start date
J

Jim L.

On a form, a user will enter data into a date control and a time control. I
have hidden controls next to them that reformat the date to read yymmdd, and
the time to read hhmm without the slashes, colons or spaces. How can I
combine these two controls to become a unique report number?
 
Format([DateField], "yymmdd") & "-" & Format([TimeField], "hhmm")

or the out the "-" altogether. BTW, You can put both in a single textbox and
still format them like the above, using slightly different syntax.
 
Thanks Mr. Meyer. I was close, but this worked perfectly.

Arvin Meyer said:
Format([DateField], "yymmdd") & "-" & Format([TimeField], "hhmm")

or the out the "-" altogether. BTW, You can put both in a single textbox and
still format them like the above, using slightly different syntax.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Jim L. said:
On a form, a user will enter data into a date control and a time control.
I
have hidden controls next to them that reformat the date to read yymmdd,
and
the time to read hhmm without the slashes, colons or spaces. How can I
combine these two controls to become a unique report number?
 
For that matter, you could also use

Format([DateField] + [TimeField], "yymmdd-hhnn")

or

Format([DateField] + [TimeField], "yymmdd hhnn")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Arvin Meyer said:
Format([DateField], "yymmdd") & "-" & Format([TimeField], "hhmm")

or the out the "-" altogether. BTW, You can put both in a single textbox
and still format them like the above, using slightly different syntax.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Jim L. said:
On a form, a user will enter data into a date control and a time control.
I
have hidden controls next to them that reformat the date to read yymmdd,
and
the time to read hhmm without the slashes, colons or spaces. How can I
combine these two controls to become a unique report number?
 
Back
Top