D
DubboPete
Hi all,
I have a bit of code which sends an email (Novell Groupwise). It
fails when I first click the command button, but once I hit the [END]
button for the error (as in End/Debug screen), and then click the
command button again, the darned thing works!
Can anybody see from the code below why it should fail at the first
attempt, but then work on the second attempt??
thanks in anticipation
<snip>
Dim StrWho As String
Dim StrFullname As String
Dim StrAmount As String
Dim StrNextDate As String
StrWho = Me.Text20 & "@gwahs.health.nsw.gov.au"
StrFullname = DLookup("[FIRSTNAME]", "TblMEMBERS", "[ID] = [Forms]!
[FrmPAYMENTS]![COMBO9]") & " " & DLookup("[SURNAME]", "TblMEMBERS",
"[ID] = [Forms]![FrmPAYMENTS]![COMBO9]")
StrAmount = Me.PAIDAMOUNT
StrNextDate = Me.NEXTDUE
DoCmd.SetWarnings False
DoCmd.OpenQuery "QrymkPayRecords"
DoCmd.SetWarnings True
Me.Text20 = DLookup("[FIRSTNAME]", "TblMEMBERS", "[ID] = [Forms]!
[FrmPAYMENTS]![COMBO9]") & "." & DLookup("[SURNAME]", "TblMEMBERS",
"[ID] = [Forms]![FrmPAYMENTS]![COMBO9]")
Me.Refresh
DoCmd.SendObject , , , StrWho, "", "", "Lotto Payment Receipt of
$" & StrAmount, , False, ""
MsgBox "A Lotto Receipt for $" & StrAmount & " has been emailed to
" & StrFullname
Combo9.SetFocus
</snip>
DubboPete
I have a bit of code which sends an email (Novell Groupwise). It
fails when I first click the command button, but once I hit the [END]
button for the error (as in End/Debug screen), and then click the
command button again, the darned thing works!
Can anybody see from the code below why it should fail at the first
attempt, but then work on the second attempt??
thanks in anticipation
<snip>
Dim StrWho As String
Dim StrFullname As String
Dim StrAmount As String
Dim StrNextDate As String
StrWho = Me.Text20 & "@gwahs.health.nsw.gov.au"
StrFullname = DLookup("[FIRSTNAME]", "TblMEMBERS", "[ID] = [Forms]!
[FrmPAYMENTS]![COMBO9]") & " " & DLookup("[SURNAME]", "TblMEMBERS",
"[ID] = [Forms]![FrmPAYMENTS]![COMBO9]")
StrAmount = Me.PAIDAMOUNT
StrNextDate = Me.NEXTDUE
DoCmd.SetWarnings False
DoCmd.OpenQuery "QrymkPayRecords"
DoCmd.SetWarnings True
Me.Text20 = DLookup("[FIRSTNAME]", "TblMEMBERS", "[ID] = [Forms]!
[FrmPAYMENTS]![COMBO9]") & "." & DLookup("[SURNAME]", "TblMEMBERS",
"[ID] = [Forms]![FrmPAYMENTS]![COMBO9]")
Me.Refresh
DoCmd.SendObject , , , StrWho, "", "", "Lotto Payment Receipt of
$" & StrAmount, , False, ""
MsgBox "A Lotto Receipt for $" & StrAmount & " has been emailed to
" & StrFullname
Combo9.SetFocus
</snip>
DubboPete