Formatting Excel Output File

  • Thread starter Jackson via AccessMonster.com
  • Start date
J

Jackson via AccessMonster.com

Hi,

I've got a macro converted to a module which emails a query to a few people
in excel format. I need to format some of the fields to 4 decimal places and
have no idea how to begin (can't write VBA), can anyone help me?

Do I have to insert something like Format(myquery,[FieldtoFormat],4) - am I
on the right track?

Here's my code for it: let me know if you have any ideas, bearing in mind I
am very beginner with VBA...

Option Compare Database

'------------------------------------------------------------
' mcrEmail
'
'------------------------------------------------------------
Function mcrEmail()
On Error GoTo mcrEmail_Err

DoCmd.SendObject acQuery, "qryUpcomingExpiry", "MicrosoftExcelBiff8(*.xls)",
"address1", "Adress2", "", "MySubject", "My Body.", True, ""
MsgBox "Email Sent Successfully", vbInformation, "Email Status"

mcrEmail_Exit:
Exit Function

mcrEmail_Err:
MsgBox "Email has not been Sent", vbInformation, "Email Status"
Resume mcrEmail_Exit

End Function
 
B

Bas Cost Budde

format(yournumber,"#.0000")

Read the Help for Format, too.
I've got a macro converted to a module which emails a query to a few people
in excel format. I need to format some of the fields to 4 decimal places and
have no idea how to begin (can't write VBA), can anyone help me?

Do I have to insert something like Format(myquery,[FieldtoFormat],4) - am I
on the right track?

Yes! You should consult the Help file with those questions. :) Your
thinking is good.
 

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