Startup Popup

L

leo

Hi guy's,
just a quick one (i hope)

Is there any way to be able to run a popup when the database is started each
time that says something like "Don't forget to run your daily reports" then
an ok button to clear.
also,
just got asked if there is any way to have an email sent to someone once a
yes/no field has been ticked yes?
I have a field that people will tick if the record they are filling in is a
"breach".
I do have a "save record" button on the form if that helps.

Thanks for all your help in the past.
Leo
 
L

leo

Startup issues resolved, added a msgbox in the startup macro.

but help on the email issues would be good.
thanks
 
P

pietlinden

leo said:
Startup issues resolved, added a msgbox in the startup macro.

but help on the email issues would be good.
thanks
Private Sub Active_AfterUpdate()
MsgBox "Send message to " & Me.FirstName & " " & Me.LastName,
vbOKOnly
Call VerySimpleSendMailWithCDOSample
End Sub


Public Sub VerySimpleSendMailWithCDOSample()
' requires reference to cdosys.dll
'--- copied w/o mods from Lyle Fairfield

Dim iCfg As CDO.Configuration
Dim iMsg As CDO.Message

Set iCfg = New CDO.Configuration
Set iMsg = New CDO.Message

With iCfg.Fields
..Item(cdoSendUsingMethod) = cdoSendUsingPort
..Item(cdoSMTPServerPort) = 25
..Item(cdoSMTPServer) = "SMTP.SomeDomain.Com"
..Item(cdoSMTPAuthenticate) = cdoBasic
..Item(cdoSendUserName) = "UserName"
..Item(cdoSendPassword) = "PassWord"
..Item(cdoSendEmailAddress) = "Some One<[email protected]>"
..Update
End With

With iMsg
..Configuration = iCfg
..Subject = "Whatever"
..To = "[email protected]"
..TextBody = CurrentProject.Connection.Execute("SELECT * FROM FirstTable
").GetString(adClipString, , vbTab, vbNewLine, "")
..Send
End With

Set iMsg = Nothing
Set iCfg = Nothing

End Sub
 
Top