Dear Duane,
I can't figure out what's wrong this this line. please help.
strTotalAirVisaInsuranceReceivedPercent = Nz(IIf(strAirTicketInsuranceVisaTotal = 0, 0, Nz(strTotalAirVisaInsuranceReceived, 0) / strAirTicketInsuranceVisaTotal), 0)
My problem is either strAirTicketInsuranceVisaTota or strAirTicketInsuranceVisaTotal are Null or zero, it will block the whole process.
Best Regards,
Kevin
--------------------------------------------
On Tue, 1/29/19, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Subject: Re: [MS_AccessPros] Debug.Print does not work
To: "MS_Access_Professionals@yahoogroups.com" <MS_Access_Professionals@yahoogroups.com>
Date: Tuesday, January 29, 2019, 12:38 PM
Hi Kevin,
It doesn't work like that. I think the instructions are
fairly simple. If you don't understand about break
points of compiling your VBA code, try Bing/Google for more
information.
Duane
From:
MS_Access_Professionals@yahoogroups.com
<MS_Access_Professionals@yahoogroups.com> on behalf of
qingqinga@yahoo.com [MS_Access_Professionals]
<MS_Access_Professionals@yahoogroups.com>
Sent: Monday, January 28, 2019 10:30 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Debug.Print does not
work
Dear
Duane,
May I phone you for just few minutes? Thanks in advance.
Best Regards,
Kevin
--------------------------------------------
On Tue, 1/29/19, Duane Hookom duanehookom@hotmail.com
[MS_Access_Professionals]
<MS_Access_Professionals@yahoogroups.com> wrote:
Subject: Re: [MS_AccessPros] Debug.Print does not work
To: "ms_access_professionals@yahoogroups.com"
<ms_access_professionals@yahoogroups.com>
Date: Tuesday, January 29, 2019, 12:10 PM
Does the code compile? Have
you set a break point and stepped through the lines of
code?
Duane
Get Outlook for iOS
From:
ms_access_professionals@yahoogroups.com on behalf of
qingqinga@yahoo.com [MS_Access_Professionals]
<ms_access_professionals@yahoogroups.com>
Sent: Monday, January 28, 2019 9:47 PM
To: ms_access_professionals@yahoogroups.com
Subject: [MS_AccessPros] Debug.Print does not work
Dear All,
Debug does not work this this code. Please help:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo ErrHandle
Me.RecordDate = Date
Me.TransactionEmployeeID = Forms!frmWelcome!EmployeeID
Dim strSQL As String
Dim strContractCurrency As String
Dim strFinalCurrency As String
Dim strContractTotalAmount As Long '地接合同款
Dim strContractTotalAmountReceived As Long
'地接团款已收
Dim strContractTotalAmountReceivedTXT As String
Dim strContractTotalAmountNotReceived
'地接团款未收
Dim strContractTotalAmountNotReceivedTXT As String
Dim strContractTotalAmountReceivedPercent As Long
'收到百分比
Dim strContractTotalAmountNotReceivedPercent As Long
'未收到百分比
Dim strAirTicketInsuranceVisaTotal As Long
'机保签款
Dim strTotalAirVisaInsuranceReceived As Long
'机保签已收
Dim strTotalAirVisaInsuranceReceivedTXT As String
Dim strTotalAirVisaInsuranceNotReceived As Long
'机保签未收
Dim strTotalAirVisaInsuranceNotReceivedTXT As String
Dim strTotalAirVisaInsuranceReceivedPercent As Long
'收到百分比
Dim strTotalAirVisaInsuranceNotReceivedPercent As Long
'未收到百分比
strContractCurrency =
ELookup("ContractCurrency",
"tblGroup", "GroupID=" &
Nz(Me.GroupID, 0))
strFinalCurrency = ELookup("FinalCurrency",
"tblGroup", "GroupID=" &
Nz(Me.GroupID, 0))
strContractTotalAmount =
ELookup("ContractTotalAmount",
"tblGroup", "GroupID=" &
Nz(Me.GroupID, 0))
strAirTicketInsuranceVisaTotal =
ELookup("AirTicketInsuranceVisaTotal",
"tblGroup", "GroupID=" &
Nz(Me.GroupID, 0))
strContractTotalAmountReceived =
Nz(DSum("AmountContract",
"qryTransactionTotalCalc",
"Checked="
& True & "AND OfficeLocationID=" &
1
& "AND CostTypeID=" & 17 &
"AND
GroupID=" & Nz(Me.GroupID, 0)), 0)
strContractTotalAmountReceivedTXT = strContractCurrency
& " " &
strContractTotalAmountReceived
strContractTotalAmountNotReceived = strContractTotalAmount
-
strContractTotalAmountReceived
strContractTotalAmountNotReceivedTXT =
strContractCurrency
& " " &
strContractTotalAmountNotReceived
strContractTotalAmountReceivedPercent =
IIf(strContractTotalAmount = 0, "",
strContractTotalAmountReceived /
strContractTotalAmount)
strContractTotalAmountNotReceivedPercent =
IIf(strContractTotalAmount = 0, "",
strContractTotalAmountNotReceived /
strContractTotalAmount)
strTotalAirVisaInsuranceReceived =
Nz(DSum("AmountFinal",
"qryTransactionTotalCalc",
"Checked="
& True & "AND OfficeLocationID=" &
1
& "AND CostTypeID=" & 21 &
"AND
GroupID=" & Nz(Me.GroupID, 0)), 0)
strTotalAirVisaInsuranceReceivedTXT = strFinalCurrency
&
" " & strTotalAirVisaInsuranceReceived
strTotalAirVisaInsuranceNotReceived =
strAirTicketInsuranceVisaTotal -
strTotalAirVisaInsuranceReceived
strTotalAirVisaInsuranceNotReceivedTXT =
strFinalCurrency
& " " &
strTotalAirVisaInsuranceNotReceived
strTotalAirVisaInsuranceReceivedPercent =
IIf(strAirTicketInsuranceVisaTotal = 0, "",
strTotalAirVisaInsuranceReceived /
strAirTicketInsuranceVisaTotal)
strTotalAirVisaInsuranceNotReceivedPercent =
IIf(strAirTicketInsuranceVisaTotal = 0, "",
strTotalAirVisaInsuranceNotReceived /
strAirTicketInsuranceVisaTotal)
strSQL = "UPDATE tblGroup " & _
"SET [ContractTotalAmountReceived] = " &
strContractTotalAmountReceived & ", " &
_
"SET [ContractTotalAmountReceivedTXT] = '
"
& strContractTotalAmountReceivedTXT & "
',
" & _
"SET [ContractTotalAmountNotReceived] = "
&
strContractTotalAmountNotReceived & ", "
&
_
"SET [ContractTotalAmountNotReceivedTXT] = '
"
& strContractTotalAmountNotReceivedTXT & "
', " & _
"SET [ContractTotalAmountReceivedPercent] = "
& strContractTotalAmountReceivedPercent &
",
" & _
"SET [ContractTotalAmountNotReceivedPercent] =
"
& strContractTotalAmountNotReceivedPercent &
",
" & _
"SET [TotalAirVisaInsuranceReceived] = "
&
strTotalAirVisaInsuranceReceived & ", "
&
_
"SET [TotalAirVisaInsuranceReceivedTXT] = '
"
& strTotalAirVisaInsuranceReceivedTXT & "
', " & _
"SET [TotalAirVisaInsuranceNotReceived] = "
&
strTotalAirVisaInsuranceNotReceived & ",
"
& _
"SET [TotalAirVisaInsuranceNotReceivedTXT] = '
" & strTotalAirVisaInsuranceNotReceivedTXT
&
" ', " & _
"SET [TotalAirVisaInsuranceReceivedPercent] =
"
& strTotalAirVisaInsuranceReceivedPercent &
",
" & _
"SET [TotalAirVisaInsuranceNotReceivedPercent] =
"
& strTotalAirVisaInsuranceNotReceivedPercent &
_
" WHERE GroupID = " & Me.GroupID
Debug.Print strSQL
CurrentDb.Execute strSQL, dbFailOnError
ErrExit:
Exit Sub
ErrHandle:
Resume ErrExit
End Sub
Thanks in advance,
Best Regards,
Kevin
------------------------------------
Posted by: <zhao.liqing@yahoo.com>
------------------------------------
------------------------------------
Yahoo Groups Links
http://groups.yahoo.com/group/MS_Access_Professionals/
Individual Email | Traditional
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com
MS_Access_Professionals-unsubscribe@yahoogroups.com
https://info.yahoo.com/legal/us/yahoo/utos/terms/
#yiv2987444454 #yiv2987444454 --
#yiv2987444454ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px
0;padding:0 10px;}
#yiv2987444454 #yiv2987444454ygrp-mkp hr {
border:1px solid #d8d8d8;}
#yiv2987444454 #yiv2987444454ygrp-mkp #yiv2987444454hd
{
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}
#yiv2987444454 #yiv2987444454ygrp-mkp #yiv2987444454ads
{
margin-bottom:10px;}
#yiv2987444454 #yiv2987444454ygrp-mkp .yiv2987444454ad
{
padding:0 0;}
#yiv2987444454 #yiv2987444454ygrp-mkp .yiv2987444454ad p
{
margin:0;}
#yiv2987444454 #yiv2987444454ygrp-mkp .yiv2987444454ad a
{
color:#0000ff;text-decoration:none;}
#yiv2987444454 #yiv2987444454ygrp-sponsor
#yiv2987444454ygrp-lc {
font-family:Arial;}
#yiv2987444454 #yiv2987444454ygrp-sponsor
#yiv2987444454ygrp-lc #yiv2987444454hd {
margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}
#yiv2987444454 #yiv2987444454ygrp-sponsor
#yiv2987444454ygrp-lc .yiv2987444454ad {
margin-bottom:10px;padding:0 0;}
#yiv2987444454 #yiv2987444454actions {
font-family:Verdana;font-size:11px;padding:10px 0;}
#yiv2987444454 #yiv2987444454activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}
#yiv2987444454 #yiv2987444454activity span {
font-weight:700;}
#yiv2987444454 #yiv2987444454activity span:first-child
{
text-transform:uppercase;}
#yiv2987444454 #yiv2987444454activity span a {
color:#5085b6;text-decoration:none;}
#yiv2987444454 #yiv2987444454activity span span {
color:#ff7900;}
#yiv2987444454 #yiv2987444454activity span
.yiv2987444454underline {
text-decoration:underline;}
#yiv2987444454 .yiv2987444454attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}
#yiv2987444454 .yiv2987444454attach div a {
text-decoration:none;}
#yiv2987444454 .yiv2987444454attach img {
border:none;padding-right:5px;}
#yiv2987444454 .yiv2987444454attach label {
display:block;margin-bottom:5px;}
#yiv2987444454 .yiv2987444454attach label a {
text-decoration:none;}
#yiv2987444454 blockquote {
margin:0 0 0 4px;}
#yiv2987444454 .yiv2987444454bold {
font-family:Arial;font-size:13px;font-weight:700;}
#yiv2987444454 .yiv2987444454bold a {
text-decoration:none;}
#yiv2987444454 dd.yiv2987444454last p a {
font-family:Verdana;font-weight:700;}
#yiv2987444454 dd.yiv2987444454last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}
#yiv2987444454 dd.yiv2987444454last p
span.yiv2987444454yshortcuts {
margin-right:0;}
#yiv2987444454 div.yiv2987444454attach-table div div a
{
text-decoration:none;}
#yiv2987444454 div.yiv2987444454attach-table {
width:400px;}
#yiv2987444454 div.yiv2987444454file-title a,
#yiv2987444454
div.yiv2987444454file-title a:active, #yiv2987444454
div.yiv2987444454file-title a:hover, #yiv2987444454
div.yiv2987444454file-title a:visited {
text-decoration:none;}
#yiv2987444454 div.yiv2987444454photo-title a,
#yiv2987444454 div.yiv2987444454photo-title a:active,
#yiv2987444454 div.yiv2987444454photo-title a:hover,
#yiv2987444454 div.yiv2987444454photo-title a:visited {
text-decoration:none;}
#yiv2987444454 div#yiv2987444454ygrp-mlmsg
#yiv2987444454ygrp-msg p a span.yiv2987444454yshortcuts
{
font-family:Verdana;font-size:10px;font-weight:normal;}
#yiv2987444454 .yiv2987444454green {
color:#628c2a;}
#yiv2987444454 .yiv2987444454MsoNormal {
margin:0 0 0 0;}
#yiv2987444454 o {
font-size:0;}
#yiv2987444454 #yiv2987444454photos div {
float:left;width:72px;}
#yiv2987444454 #yiv2987444454photos div div {
border:1px solid
#666666;min-height:62px;overflow:hidden;width:62px;}
#yiv2987444454 #yiv2987444454photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}
#yiv2987444454 #yiv2987444454reco-category {
font-size:77%;}
#yiv2987444454 #yiv2987444454reco-desc {
font-size:77%;}
#yiv2987444454 .yiv2987444454replbq {
margin:4px;}
#yiv2987444454 #yiv2987444454ygrp-actbar div a:first-child
{
margin-right:2px;padding-right:5px;}
#yiv2987444454 #yiv2987444454ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean,
sans-serif;}
#yiv2987444454 #yiv2987444454ygrp-mlmsg table {
font-size:inherit;font:100%;}
#yiv2987444454 #yiv2987444454ygrp-mlmsg select,
#yiv2987444454 input, #yiv2987444454 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}
#yiv2987444454 #yiv2987444454ygrp-mlmsg pre,
#yiv2987444454
code {
font:115% monospace;}
#yiv2987444454 #yiv2987444454ygrp-mlmsg * {
line-height:1.22em;}
#yiv2987444454 #yiv2987444454ygrp-mlmsg #yiv2987444454logo
{
padding-bottom:10px;}
#yiv2987444454 #yiv2987444454ygrp-msg p a {
font-family:Verdana;}
#yiv2987444454 #yiv2987444454ygrp-msg
p#yiv2987444454attach-count span {
color:#1E66AE;font-weight:700;}
#yiv2987444454 #yiv2987444454ygrp-reco
#yiv2987444454reco-head {
color:#ff7900;font-weight:700;}
#yiv2987444454 #yiv2987444454ygrp-reco {
margin-bottom:20px;padding:0px;}
#yiv2987444454 #yiv2987444454ygrp-sponsor
#yiv2987444454ov
li a {
font-size:130%;text-decoration:none;}
#yiv2987444454 #yiv2987444454ygrp-sponsor
#yiv2987444454ov
li {
font-size:77%;list-style-type:square;padding:6px 0;}
#yiv2987444454 #yiv2987444454ygrp-sponsor
#yiv2987444454ov
ul {
margin:0;padding:0 0 0 8px;}
#yiv2987444454 #yiv2987444454ygrp-text {
font-family:Georgia;}
#yiv2987444454 #yiv2987444454ygrp-text p {
margin:0 0 1em 0;}
#yiv2987444454 #yiv2987444454ygrp-text tt {
font-size:120%;}
#yiv2987444454 #yiv2987444454ygrp-vital ul li:last-child
{
border-right:none !important;
}
#yiv2987444454
------------------------------------
Posted by: <zhao.liqing@yahoo.com>
------------------------------------
------------------------------------
Yahoo Groups Links
http://groups.yahoo.com/group/MS_Access_Professionals/
Individual Email | Traditional
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com
MS_Access_Professionals-unsubscribe@yahoogroups.com
https://info.yahoo.com/legal/us/yahoo/utos/terms/
#yiv2841030993 #yiv2841030993 --
#yiv2841030993ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px
0;padding:0 10px;}
#yiv2841030993 #yiv2841030993ygrp-mkp hr {
border:1px solid #d8d8d8;}
#yiv2841030993 #yiv2841030993ygrp-mkp #yiv2841030993hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}
#yiv2841030993 #yiv2841030993ygrp-mkp #yiv2841030993ads {
margin-bottom:10px;}
#yiv2841030993 #yiv2841030993ygrp-mkp .yiv2841030993ad {
padding:0 0;}
#yiv2841030993 #yiv2841030993ygrp-mkp .yiv2841030993ad p {
margin:0;}
#yiv2841030993 #yiv2841030993ygrp-mkp .yiv2841030993ad a {
color:#0000ff;text-decoration:none;}
#yiv2841030993 #yiv2841030993ygrp-sponsor
#yiv2841030993ygrp-lc {
font-family:Arial;}
#yiv2841030993 #yiv2841030993ygrp-sponsor
#yiv2841030993ygrp-lc #yiv2841030993hd {
margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}
#yiv2841030993 #yiv2841030993ygrp-sponsor
#yiv2841030993ygrp-lc .yiv2841030993ad {
margin-bottom:10px;padding:0 0;}
#yiv2841030993 #yiv2841030993actions {
font-family:Verdana;font-size:11px;padding:10px 0;}
#yiv2841030993 #yiv2841030993activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}
#yiv2841030993 #yiv2841030993activity span {
font-weight:700;}
#yiv2841030993 #yiv2841030993activity span:first-child {
text-transform:uppercase;}
#yiv2841030993 #yiv2841030993activity span a {
color:#5085b6;text-decoration:none;}
#yiv2841030993 #yiv2841030993activity span span {
color:#ff7900;}
#yiv2841030993 #yiv2841030993activity span
.yiv2841030993underline {
text-decoration:underline;}
#yiv2841030993 .yiv2841030993attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}
#yiv2841030993 .yiv2841030993attach div a {
text-decoration:none;}
#yiv2841030993 .yiv2841030993attach img {
border:none;padding-right:5px;}
#yiv2841030993 .yiv2841030993attach label {
display:block;margin-bottom:5px;}
#yiv2841030993 .yiv2841030993attach label a {
text-decoration:none;}
#yiv2841030993 blockquote {
margin:0 0 0 4px;}
#yiv2841030993 .yiv2841030993bold {
font-family:Arial;font-size:13px;font-weight:700;}
#yiv2841030993 .yiv2841030993bold a {
text-decoration:none;}
#yiv2841030993 dd.yiv2841030993last p a {
font-family:Verdana;font-weight:700;}
#yiv2841030993 dd.yiv2841030993last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}
#yiv2841030993 dd.yiv2841030993last p
span.yiv2841030993yshortcuts {
margin-right:0;}
#yiv2841030993 div.yiv2841030993attach-table div div a {
text-decoration:none;}
#yiv2841030993 div.yiv2841030993attach-table {
width:400px;}
#yiv2841030993 div.yiv2841030993file-title a, #yiv2841030993
div.yiv2841030993file-title a:active, #yiv2841030993
div.yiv2841030993file-title a:hover, #yiv2841030993
div.yiv2841030993file-title a:visited {
text-decoration:none;}
#yiv2841030993 div.yiv2841030993photo-title a,
#yiv2841030993 div.yiv2841030993photo-title a:active,
#yiv2841030993 div.yiv2841030993photo-title a:hover,
#yiv2841030993 div.yiv2841030993photo-title a:visited {
text-decoration:none;}
#yiv2841030993 div#yiv2841030993ygrp-mlmsg
#yiv2841030993ygrp-msg p a span.yiv2841030993yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}
#yiv2841030993 .yiv2841030993green {
color:#628c2a;}
#yiv2841030993 .yiv2841030993MsoNormal {
margin:0 0 0 0;}
#yiv2841030993 o {
font-size:0;}
#yiv2841030993 #yiv2841030993photos div {
float:left;width:72px;}
#yiv2841030993 #yiv2841030993photos div div {
border:1px solid
#666666;min-height:62px;overflow:hidden;width:62px;}
#yiv2841030993 #yiv2841030993photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}
#yiv2841030993 #yiv2841030993reco-category {
font-size:77%;}
#yiv2841030993 #yiv2841030993reco-desc {
font-size:77%;}
#yiv2841030993 .yiv2841030993replbq {
margin:4px;}
#yiv2841030993 #yiv2841030993ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}
#yiv2841030993 #yiv2841030993ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean,
sans-serif;}
#yiv2841030993 #yiv2841030993ygrp-mlmsg table {
font-size:inherit;font:100%;}
#yiv2841030993 #yiv2841030993ygrp-mlmsg select,
#yiv2841030993 input, #yiv2841030993 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}
#yiv2841030993 #yiv2841030993ygrp-mlmsg pre, #yiv2841030993
code {
font:115% monospace;}
#yiv2841030993 #yiv2841030993ygrp-mlmsg * {
line-height:1.22em;}
#yiv2841030993 #yiv2841030993ygrp-mlmsg #yiv2841030993logo {
padding-bottom:10px;}
#yiv2841030993 #yiv2841030993ygrp-msg p a {
font-family:Verdana;}
#yiv2841030993 #yiv2841030993ygrp-msg
p#yiv2841030993attach-count span {
color:#1E66AE;font-weight:700;}
#yiv2841030993 #yiv2841030993ygrp-reco
#yiv2841030993reco-head {
color:#ff7900;font-weight:700;}
#yiv2841030993 #yiv2841030993ygrp-reco {
margin-bottom:20px;padding:0px;}
#yiv2841030993 #yiv2841030993ygrp-sponsor #yiv2841030993ov
li a {
font-size:130%;text-decoration:none;}
#yiv2841030993 #yiv2841030993ygrp-sponsor #yiv2841030993ov
li {
font-size:77%;list-style-type:square;padding:6px 0;}
#yiv2841030993 #yiv2841030993ygrp-sponsor #yiv2841030993ov
ul {
margin:0;padding:0 0 0 8px;}
#yiv2841030993 #yiv2841030993ygrp-text {
font-family:Georgia;}
#yiv2841030993 #yiv2841030993ygrp-text p {
margin:0 0 1em 0;}
#yiv2841030993 #yiv2841030993ygrp-text tt {
font-size:120%;}
#yiv2841030993 #yiv2841030993ygrp-vital ul li:last-child {
border-right:none !important;
}
#yiv2841030993
Posted by: <zhao.liqing@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (11) |
Tidak ada komentar:
Posting Komentar