By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,306 Members | 1,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,306 IT Pros & Developers. It's quick & easy.

Crazy email button

P: n/a
ng1
Hello , I am writing in order to get your valuable help .
I have been working on a job which involves sending emails thorough
Access.
I created a form , a very simple one with a few fields to fill in ,
which enables the user to send an email message based on the form's
content .
Everything works fine , after clicking the email button a nice and
formatted email message shows up .
Unfortunately the problem is that , if I immediately create a new
record and try to get a new email message by clicking the above
mentioned button , nothing
happens.
The email button on the form suddenly stops working .
My temporary solution relies on closing and reopening the form .
After that I hit the email button again and everything works fine , but
only ONCE !!! Unfortunately , I keep opening an closing the form and I
know that it doesn't make sense . Does it ?
Here's the code . What's wrong with it ?
Any help will be highly appreciated.
Many thanks in advance MATTEO

.................................................. .................................................. ................................................

Private Sub cmdEmail_Click()

Dim Email As String '-- Ind Email
Dim stText As String '-- Corpo messaggio email
Dim stSubject As String '-- Oggetto email
Dim stNome As String '-- Nome utente
Dim stCognome As String '-- Cognome utente
Dim stSede As String '-- Sede
Dim NumRich As Long '-- N° richiesta
Dim stElenco As String '-- Dettagli merce
'-- Attribuzione valore variabile Ind email
Email = Me.Email

stSubject = " <> Azienda Pippo <> "
'-- Definizione valori variabili

stNome = Me.Nome
stCognome = Me.Cognome
stSede = Me.TipoSede
stElenco = Me.Elenco
NumRich = Me.N°Richiesta

stText = "Azienda Pippo " & Chr$(13) & Chr$(13) & vbCrLf & _

"************************************************* *************************"
& vbCrLf & _
"Gentile : " & stCognome & Chr$(13) & _
" " & stNome & Chr$(13) & vbCrLf & _
"In riferimento alla Sua richiesta n °" & NumRich & "
abbiamo provveduto ad evadere quanto segue : " & Chr$(13) & vbCrLf & _
"" & stElenco & Chr$(13) & vbCrLf & _
"merce disponibile per il ritiro presso : " & stSede &
Chr$(13) & vbCrLf & _
"Cordiali saluti" & Chr$(13) & vbCrLf & _
"Azienda Pippo" & Chr$(13) & vbCrLf & _
"-----------------------" & Chr$(13) & vbCrLf & _

"************************************************* *************************"

Dim strMessage As String
Dim strTitle As String
DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, -1
Exit Sub

End Sub

.................................................. .................................................. .................................................. ..

May 11 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.