Thanks Bob, It all seems to hinge on the fact that I cant seem to get access to halt prompting for the parameter value which at this point is held in the unloaded form. Access hated the docmd.quit even more!
I'm using this code now which I worked out from yours and it works fine.
Me.txtEmailSubject.SetFocus
Me.cmdSendEmail.Enabled = False
Me.lblNotification.Visible = True
Dim sToName As String
Dim sSubject As String
Dim sMessageBody As String
Dim VarHistoryID As String
Dim VarPDId As String
Dim...
I've created a custom Home ribbon in my A2207Db and some of the ribbon commands are to allow users to open certain forms. Some of my forms reply on values in a splashscreen and that only opens after a user has logged in via a password form.
I need Access to check if a form is open and if its...
I had downloaded the Collaboration Data Objects, version 1.2.1 and installed locally on my vista machine
And added CDO 1.2.1 Library as a reference in Access Vb
Many thanks for this. Just doing some testing and keep getting the "sendusing" configuration value is invalid
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "smtp.servername.com"
I'm assuming its this value which its struggling with?
This should be an interesting question which if answered should help people out in future. I've just about finished my first A2007 project which I'm deploying with the runtime licence.
In full access its easy to switch those warnings off but that cant be done, to my knowledge, in runtime...
Hi P, Actually I tested it under V2007 runtime and I dont think runtime version likes table making! Following your advice have changed to append with delete string to empty it afterwards.
I'm actually down in Hampshire these days - must update my profile!
I think youre right. I got around it by creating an OnOpen event on the form to a make table query (based on user filter selections) and then based the code on that table and then when the emails are sent and the form closes it deletes the table.
I been successfully tesing the code with a simple qry but when I try to use it with a Qry which includes more than one table (in qbe) I get an error "too few parameters. Expected 4" any ideas why this might be going on?
Good one! Yeah, didnt realise that it was really looking for an email address rather than To "John" etc. Changed the code as follows which now works. Hopefully this will be useful to others! Thanks P!!
f IsNull(![Email Address]) = False Then
sToName = ![Email Address]...
Thanks P, Yes did try and that line worked. Now the code works to that point but debugs on the following lines with error "Unknown message recipient"
DoCmd.SendObject acSendNoObject, , , _
sToName, , , sSubject, sMessageBody, False, False
Its producing error "Item not found in this collection" and debugs to this line:
sToName = .Fields(![First Name])
If I remove the bang then I get an error "Cant fine the field "|" referred to... Although the field is there.
I've changed the code slightly to reflect my Db but just get an error message "Cant find the field |
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Dim sToName As String
Dim sSubject As String
Dim sMessageBody As String
Set MyDb = CurrentDb()
Set rsEmail =...
I found this code which enables sending outlook email without the security warning. I have a query containing email addresses and I'd like to understand a method where I can get the code to loop through to send multiple emails?
Option Explicit
' ACCESS VBA MODULE: Send E-mail without Security...