Chi Is Current
asked on
"Format(Date)" command in a form function crashes access on SOME workstations; not others
Hello ~
The "Format(Date)" command in a form function - to insert the date in an email message below - crashes Access (Microsoft Access has encountered a problem and needs to close, yada yada yada.....) on SOME workstations and not others!? All workstations are running WXP, Outlook 2003, Access 2000 - SP-3. And all workstations have the same libraries referenced.
When I remove the "Format(Date)" command it runs fine.
I'm stumped. Can someone explain why this code runs on only some installations?
Many Thanks, Jacob
-------------------------- ---------- ---------- ---------- ---------- ---------
Dim objMailItem As Outlook.MailItem
Dim olkApp As Outlook.Application
Dim olkNameSpace As NameSpace
Set olkApp = New Outlook.Application
Set olkNameSpace = olkApp.GetNamespace("MAPI" )
Set objMailItem = olkApp.CreateItem(olMailIt em)
With objMailItem
.To = Forms!frmOrders!frmCountRe q!contEmai l
.Recipients.ResolveAll
Select Case Frame71.Value
Case 1 ' Letter #1
.HTMLBody = "<HTML><FONT SIZE=2>" & Format(Date) & " <BR><BR>>>For fastest response...........
The "Format(Date)" command in a form function - to insert the date in an email message below - crashes Access (Microsoft Access has encountered a problem and needs to close, yada yada yada.....) on SOME workstations and not others!? All workstations are running WXP, Outlook 2003, Access 2000 - SP-3. And all workstations have the same libraries referenced.
When I remove the "Format(Date)" command it runs fine.
I'm stumped. Can someone explain why this code runs on only some installations?
Many Thanks, Jacob
--------------------------
Dim objMailItem As Outlook.MailItem
Dim olkApp As Outlook.Application
Dim olkNameSpace As NameSpace
Set olkApp = New Outlook.Application
Set olkNameSpace = olkApp.GetNamespace("MAPI"
Set objMailItem = olkApp.CreateItem(olMailIt
With objMailItem
.To = Forms!frmOrders!frmCountRe
.Recipients.ResolveAll
Select Case Frame71.Value
Case 1 ' Letter #1
.HTMLBody = "<HTML><FONT SIZE=2>" & Format(Date) & " <BR><BR>>>For fastest response...........
ASKER
puppydogbuddy - Thank you for your reply. Yes, I am refering to the Date function. However, when I type as it as you suggest, the VB editor in access removes the (), changing it to Format(Date).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or whatever format you want to use.
ASKER
Yes, I see - Format(Date) is incorrect syntax. Format(Date, "mm/dd/yy") works. I'll try it on client's workstations tomorrow.
Thank you for the correction.
Best Regards, Jacob
Thank you for the correction.
Best Regards, Jacob
Glad I could help. Thanks for the points and grade.
Format(Date())
'^^^