Input format different from display format in a form 
Author Message
 Input format different from display format in a form

Hi,

I would like to let the user enter a date in the format dd-mm-yy of
dd-mm-yyyy and after the user tabs out of the formfield change the displayed
format to dd-mm. Is there a way I can get this done?

Thanks,
Gijs



Sat, 11 Dec 2004 19:06:43 GMT  
 Input format different from display format in a form
Sure, just lop off the stuff you don't need.

Format$("13-02-1999", "dd/mm") will keep only the day and month, with a
slash replacing the dash. Use that on whatever string contains your date,
instead of my literal of 13-02-1999.

--

Pete

This e-mail address is fake to keep spammers and their auto-harvesters out
of my hair. If you need to get in touch personally, I am 'pdanes' and I use
Yahoo mail. But please use the newsgroups whenever possible, so that all may
benefit from the exchange of ideas.


Quote:
> Hi,

> I would like to let the user enter a date in the format dd-mm-yy of
> dd-mm-yyyy and after the user tabs out of the formfield change the
displayed
> format to dd-mm. Is there a way I can get this done?

> Thanks,
> Gijs



Sun, 12 Dec 2004 14:01:23 GMT  
 Input format different from display format in a form

you would need to use macros tied into your entry and exit macros for
the field. The selection object can give you selection.fields(1).code
to which you can append a format instruction. The www.mvps.org/word
site does have some excellent examples of entry and exit macro coding
to get you started.

As an example, a std field's code in this situation looks like this



this:

Quote:
>Hi,

>I would like to let the user enter a date in the format dd-mm-yy of
>dd-mm-yyyy and after the user tabs out of the formfield change the displayed
>format to dd-mm. Is there a way I can get this done?

>Thanks,
>Gijs

Steve Hudson - Word Heretic, Sydney, Australia
{*filter*} teacher, trainer, tutor, writer, developer

You agree by writing to me personally that any material can be reused publicly unless you explicitly disclaim it. (For List and blog use.)


Thu, 30 Dec 2004 08:41:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Displaying different picture file formats within forms.

2. Formatting Text Form Field Input

3. different format on different monitor

4. Formatting date input in Input Box

5. Binary format to text format form conversion

6. Date format across different language OSs

7. seeing different date formats

8. Saving a range in a different file format

9. Formatting three different footers and headers with a macro in Office XP

10. Macro to convert Word files to different formats

11. Formatting three different footers and headers with macros

12. different formatting for adjacent characters?

 

 
Powered by phpBB® Forum Software