Copy part of a date to another field in a form

G

Guest

I have a data base with 2 controls. When I enter information in the first
control, this information must be copied to the 2nd control but in a specific
format.
For eg : My 1st control is a date in the format mmm-dd-yy. After I enter
info in my 1st control, the 2nd control must copy this information but the
format must be only mmm-yy.
Please assist.
 
G

Guest

just make the control source of the second control:

=Format([FirstControl], "mmm\-yy")
 
F

fredg

I have a data base with 2 controls. When I enter information in the first
control, this information must be copied to the 2nd control but in a specific
format.
For eg : My 1st control is a date in the format mmm-dd-yy. After I enter
info in my 1st control, the 2nd control must copy this information but the
format must be only mmm-yy.
Please assist.

Use an Unbound text control.
Leave it's control source blank.
Set it's Format property to:
mmm/yy


Code the first control's AfterUpdate event:

Me![SecondControlName] = Me![ThisControlName]

Note that both controls will have the same value.
The only difference is how they are displayed.
No need to store this second control's value.
 
F

fredg

I have a data base with 2 controls. When I enter information in the first
control, this information must be copied to the 2nd control but in a specific
format.
For eg : My 1st control is a date in the format mmm-dd-yy. After I enter
info in my 1st control, the 2nd control must copy this information but the
format must be only mmm-yy.
Please assist.

Use an Unbound text control.
Leave it's control source blank.
Set it's Format property to:
mmm/yy

Code the first control's AfterUpdate event:

Me![SecondControlName] = Me![ThisControlName]

Note that both controls will have the same value.
The only difference is how they are displayed.
No need to store this second control's value.

Whoops... you wanted hyphens, not /.

Set the Format property of the control to:
mmm-yy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top