Formatting Excel Output File

  • Thread starter Thread starter Jackson via AccessMonster.com
  • Start date 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
 
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.
 
Back
Top