M
mmmbl
In one of the send email procedures i use a single query to send cost
information to my vendors. This query is named "qry_COST INFORMATION" but
during the process it will get renamed to the vendor number for that
particular vendor.The procedure is working perfectly until some cancels in
between the process. When you rerun the process you will get the error an
error message that "qry_COST INFORMATION" cannot be found. This is because it
was not renamed back to the original name due to cancellation. How can i
rename the query back to the original name when the user cancel the
procedure? Here is the part where it gets rename
If IsNull(rstObjects![supplier_email]) Or rstObjects![supplier_email] = " "
Then
strEmail = rstObjects![broker_rep_email]
Else
strEmail = rstObjects![supplier_email]
End If
If IsNull(rstObjects![broker_rep_email]) Then
strEmail = rstObjects![supplier_email]
Else
strEmail = rstObjects![supplier_email] & ";" &
rstObjects![broker_rep_email]
End If
DoCmd.Rename newName, acQuery, oldName
oldName = rstObjects![vnd_num] - this is to
temporarily store the vendor number that was just sent and this
thank you
information to my vendors. This query is named "qry_COST INFORMATION" but
during the process it will get renamed to the vendor number for that
particular vendor.The procedure is working perfectly until some cancels in
between the process. When you rerun the process you will get the error an
error message that "qry_COST INFORMATION" cannot be found. This is because it
was not renamed back to the original name due to cancellation. How can i
rename the query back to the original name when the user cancel the
procedure? Here is the part where it gets rename
If IsNull(rstObjects![supplier_email]) Or rstObjects![supplier_email] = " "
Then
strEmail = rstObjects![broker_rep_email]
Else
strEmail = rstObjects![supplier_email]
End If
If IsNull(rstObjects![broker_rep_email]) Then
strEmail = rstObjects![supplier_email]
Else
strEmail = rstObjects![supplier_email] & ";" &
rstObjects![broker_rep_email]
End If
DoCmd.Rename newName, acQuery, oldName
oldName = rstObjects![vnd_num] - this is to
temporarily store the vendor number that was just sent and this
thank you