Results 1 to 13 of 13
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    E-Mail Form (A2K SP3)

    We currently have a frmSecurityRefund which has a series of check boxes that determine the amount of the security deposit that is returned to the customer. After the boxes are checked, the form calculates the amount of the refund check . There is a Print Form button on form. Currently, managers in remote locations are printing the form and faxing it to the main office for them to write a refund check to the customer.

    Once the form is printed, the input to calculate the refund is not saved. At the present time each location has a stand alone database.

    Is it possible to E-mail the form to the main office rather than printing the form and faxing?

    Thanks,

    Tom Goodwin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: E-Mail Form (A2K SP3)

    You could use File | Send To | Mail Address (as attachment)..., or its code equivalent DoCmd.SendObject. However, if the form is bound, SendObject will send all records, so you'd have to create a report that displays only the information needed, and send that. Supported formats for the attachment are .txt, .htm, .xls, .rtf (Word-compatible), .xml and for reports .snp (snapshot, requires the free Snapshot Viewer to view and print)

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: E-Mail Form (A2K SP3)

    The form is unbound.

    I have experimented with several or the file types but can't seem to get it to sent it in the same format as the form.

    I have the form displayed and have then used File, Sent to, Mail Recipient (as Attachemnt). You then are presented with a choice of formats. The .rtf appears to sent field in a single line. The HTML asked for an HTML Template which I don't know what it is looking for.

    Ideally, the receipient could view the transmitted file so it would look like the printed form.

    Tom

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: E-Mail Form (A2K SP3)

    The best way would be to create a report and send it as a snapshot (.snp). Everyone can download and install the free Snapshot Viewer from Microsoft. A snapshot will look exactly like the report, and it can be viewed and printed. Alternatively, you could convert either the form or a report to PDF format, but that requires special software. The "official" software is from Adobe (Acrobat), but there are several cheap, even free alternatives. Almost everybody already has the free Adobe viewer.

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: E-Mail Form (A2K SP3)

    I have tried using the snapshot on reports and that works well. I would think this process could be automated from the from form button on the Security Deposit Refund "Report." My problem is because of the calculations on the form, I don't know how to convert this to a report.

    I have attached copy of a portion of the database. You access frmSecurityDepositRefund by first opening frmCheckOut. Use 46720 as the receipt number. Typically here the manager would enter the Actual Check Out Date and the Notice Date (The guest must give at least 3 days notice of the departure or the deposit is forfeited.) and then Press to Call Security Deposit Refund Form button.

    The form looks up the receipt number where the deposit was originally paid, i. e. the Deposit Receipt #: 46663. The manager then can check various check boxes to determine various deductions from the security deposit or if none, use the Print Form button.

    Once the Print Form button on the form is pressed, the form is printed and the amount of the Security Deposit Refund is posted to the DepositRefundAmt field on the Deposit Receipt record. Once the amount is posted, the form can not be re-run correctly without first deleting the amount in the DepositRefundAmt field.

    Any suggestions on converting the form to a report would be greatly appreciated.

    Tom

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: E-Mail Form (A2K SP3)

    Try this:
    1) Save the form as a report (File | Save As...)
    2) Remove the Print command button from the report (it won't do anything)
    3) Clear the Record Source of the report, so that it becomes unbound.
    4) Set the Control Source of each text box, combo box and check box to refer to the corresponding control on the form, for example for the GiftCertifCheckBox check box:

    =Forms!frmSecurityDepositRefund!GiftCertifCheckBox

    5) Save the report.

    When opened from the form, the report should look just like the form and contain the same info.

  7. #7
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: E-Mail Form (A2K SP3)

    Many thanks for steering me in the right direction.

    I think I understand everything except "When opened from the form, the report should look just like the form and contain the same info." How is the report opened from the form?


    Tom

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: E-Mail Form (A2K SP3)

    The report will only work correctly if the form is open, so it's best to change the action of the Print button you now have to either open the report (the user can then use File | Send To to e-mail it), or to e-mail the report directly (using DoCmd.SendObject). The report shouldn't be opened by itself.

  9. #9
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: E-Mail Form (A2K SP3)

    What I want to do is when the Print Form button on the Security Deposit Refund Form is pressed

    1. Post DepositRefundAmt
    2. Open rptSecurityDepositRefund
    3. Print rptSecurityDepositRefund
    4. Set up the Email


    This is have I have so far:

    Private Sub cmdPrintSecurityDepositRefund_Click()
    If <trfDepositCheckBox> = -1 Then
    Me.DepositRefundAmt = 999
    Else: Me.DepositRefundAmt = Me.NetDepositAmt
    End If

    DoCmd.OpenReport "rptSecurityDepositRefund", acViewPreview
    DoCmd.PrintOut
    DoCmd.SendObject , acSendReport, acFromSNP, "ASACorporate", , , "Security Deposit Refund Form"


    End Sub

    Ever thing seems to work through step 3. The Email appears, correctly addressed, with correct subject line but the snp file is not attached.

    Any Suggestions?

    Also at this point, I have open frmCheckOut, frmSecurityDepositRefund, rptSecurityDepositRefund. What is the best way to get these objects closed?

    Tom

  10. #10
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: E-Mail Form (A2K SP3)

    Many thanks for your invaluable assistance.

    I think your suggested code needs two comma before False or the E-mail message. Without the second comma, a zero is put a the test message.

    My final code is as follows:

    Private Sub cmdPrintSecurityDepositRefund_Click()
    If <trfDepositCheckBox> = -1 Then
    Me.DepositRefundAmt = 999
    Else: Me.DepositRefundAmt = Me.NetDepositAmt
    End If

    DoCmd.OpenReport "rptSecurityDepositRefund"

    DoCmd.SendObject acSendReport, "rptSecurityDepositRefund", acFormatSNP, "GoodwinBecky", , , "Security Deposit Refund Report", "Attached is Security Deposit Refund Report snapshot file", True

    DoCmd.Close acReport, "rptSecurityDepositRefund", acSaveNo
    DoCmd.Close acForm, "frmSecurityDepositRefund", acSaveNo
    DoCmd.Close acForm, "frmCheckOut", acSaveYes

    End Sub

    Once again many thanks,

    Tom

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: E-Mail Form (A2K SP3)

    Edited by HansV to correct mistake - thanks to Tom for pointing it out.

    You've got the syntax of SendObject almost right, but not quite. Also, you can print the report directly. Try this:

    ' Print the report directly
    DoCmd.OpenReport "rptSecurityDepositRefund"
    ' Send it
    DoCmd.SendObject acSendReport, "rptSecurityDepositRefund", acFormatSNP, "ASACorporate", , , "Security Deposit Refund Form", . False

    If you want to view the e-mail before sending it, omit the , , False at the end or change it to , , True.

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: E-Mail Form (A2K SP3)

    You're correct, there should have been an extra comma. I have edited my previous reply.

    Note: closing a form with acSaveYes means that you save the design of the form, not the record. The current record will be saved automatically.

  13. #13
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: E-Mail Form (A2K SP3)

    Many thinak again.

    I have made the change to the Save command.

    Tom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •