Emailing data entered on a form - works and then doesn't work

fedupwithaccess

Registered User.
Local time
Today, 17:02
Joined
Jan 9, 2007
Messages
10
My problem is a little strange as my database works pretty well, but is now playing up since I've put navigation/main menu forms on top of it.

The database is made up of a number of forms for users to raise invoices, credit notes, new accounts, or account amendments. After completing each form the user hits the email button and the text/data from the fields on the form is sent to a specific email address.

Everything works when using the forms individual (open direct or from design mode), however I've now brought them together using menus and command buttons and for some reason the email will only work on 2 out of the 4 forms.

For instance if I create and send an invoice, it will then fail to email a credit note (but adds the details to the table) and vis-a-vis. The same happens with the new accounts and amendments. Does outlook remain open some how?

I've designed all the forms separately (rather than copying one from another) and debugged my code (which all works) so I'm a little perplexed as to why it works on one and not the other.

The code I'm using to send the mail on each form is

DoCmd.SendObject acSendNoObject, , , "joe.bloggs@company.com", , , "Purchase Ledger Invoice", StrMessage, False
DoCmd.Close acForm, "PurchaseLedgerInvoice", acSaveYes

Admittedly this could be too basic and the problem, but it does work when I test the forms individually. If the full code is needed then please let me know.

Any thoughts or assistance is greatly appreciated as this is my final hurdle so to speak.

Cheers,
Iain
 
What happens when the email dosent work? is there an error message?
 
KeithG said:
What happens when the email dosent work? is there an error message?


No, it just runs through the code to the End If (I check for blank fields first).

On the form that it does work on, it produces the object guard model. Where as it fails to activate this on the others. It's as if it cannot connect to Outlook anymore.
 

Users who are viewing this thread

Back
Top Bottom