Word Merge Question

G

Guest

I created a small database for keeping track of phone calls for my boss. I
made a table with six fields, one of them being Time OfCall. I then made a
Select Query, for filtering out old calls based on a field from my table. I
then made a small form for typing in the information, and I set the hour to
automatically record when the record was created using the Now() function. I
then created a Template for word using tables, for my merge; then using code
I found on the internet (by Ken Sheridan) I modified it a bit to fit my
needs.

Now there are two problems which should be fixed by the same procedure.
When I pass the hour to word it gives me the entire date, seconds and all,
when all I really want is hours and minutes in 24 hr format.

The second problem is that for phone numbers, I have different inputmasks
depending on how many digits I type. So if for example I only type four
digits, it means its an internal extension, so it will put Ext. and the
number, whereas if it is a 10 digit number it will put parenthesis aroung
area code and the dash in between, and if it is anything else it removes all
input masks. However, when I pass the value to word, it obviously doesn't
pass the inputmask text, it only passes the actual value stored.

I think I might know how to fix the problem for the phone, just by putting a
modified version of the input mask code into the function that handles the
merge. But I'm stumped in the date part, cause my system time is AM/PM and I
would like it to remain that way, but I want the report to be in 24 H time.
Any help would be greatly appreciated. Thanks!

p.d. BTW I use Office 2003 ... Thanks!
 
G

Guest

Hi Alex,

Change the query you are using for your word merge and force the formatting
of the date/time field as follows:

TimeCalled: format([TimeOfCall], "HH:nn")

Hope that helps.

Damian.

ps: You can use the formatting in the query to reformat your phone numbers
as per your input mask, but it will require a bit more coding. Check out the
iif statement - it would be useful for you.
 

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