November 9, 2008

Let Access tell your customers when their orders have been shipped

  • Date: September 9th, 2008
  • Author: Mary Ann Richardson

Your customers will appreciate it if you send them a shipping notification.  See how a  little command button magic allows you to automate the process in your Access forms.


For better customer service, you decide you’d like to send an e-mail message informing customers when their orders have been shipped. However, you don’t want to have your shipping personnel spend time composing those messages. Good news: They don’t have to! You’ve already created a form that your staff uses to enter the Ship Date after an item has been shipped. Just add a Command button, like the one in Figure A, to send a shipping confirmation to the customer’s e-mail address automatically.

Figure A

cialis dosage information align=”justify”>To create the button, follow these steps:

  1. Open the Form in Design Mode.
  2. Click the Command Button control and click and drag where you want to locate the button in your form.
  3. Click Cancel to cancel the Command wizard.
  4. Right-click the Command button and click Properties.
  5. Under the All tab, click in the Caption property box and enter Send Shipping Confirmation.
  6. Under the Event tab, click in the OnClick property box and then click the Build button and enter the following code at the prompt, as shown in Figure B:

Dim MessText         MessText = "Your order has shipped!" & vbCrLf & _             "Order Number:" & " " & Me.OrderID & " " & _             "Order Date:" & " " & Me.OrderDate & vbCrLf & _             "Shipped to:" & vbCrLf & _             Me.ShipName & vbCrLf & _             Me.ShipAddress & vbCrLf & _             Me.ShipCity & ", " & Me.ShipStateOrProvince & " " & Me.ShipPostalCode         DoCmd.SendObject _             ObjectType:=acSendNoObject, _             To:=Me.ShipEmail, _             Subject:="Order Confirmation", _             MessageText:=MessText, _             Editmessage:=True

  1. Press Alt + Q.

Figure B

Now, when the user enters the ship date and clicks the Send Shipping Confirmation button, Access will compose the e-mail shown in Figure C.

Figure C

The user can review the e-mail and click the Send button. Access will then send the e-mail to the address in the ShipEmail field for that order.

Permalink • Print • Comment

Leave a comment

You must be logged in to post a comment.

Made with WordPress and a search engine optimized WordPress theme • Sky Gold skin by Denis de Bernardy