Access.2007.VBA.Bibl..

(John Hannent) #1
strTitle = “Set of labels created”
strPrompt = _
“A set of shipping labels created “ _
& “for Order ID “ & lngOrderID _
& “, Product ID “ & lngProductID _
& “ (“ & strProductName & “)”
MsgBox strPrompt, vbInformation, strTitle

Figure 12.5 shows the success message for the last set of labels, with the progress meter at full in
the Access window status bar.

FIGURE 12.5
A message indicating that a set of labels has been created for an order.

End If

NextProduct:
rstOrder.MoveNext
Loop

NextOrder:
rstShip.MoveNext

Recalculate the number of sets of labels to print:

lngSelected = Nz(DCount(“*”, _
“qrySelectedNorthwindShippingLabels”))
Me![lblSetsToPrint].Caption = lngSelected _
& “ sets of shipping labels to print”
Next lngSet

DoCmd.Close acForm, Me.Name

Finished:
strTitle = “Finished!”
strPrompt = _
“One set of shipping labels created for each “ _

Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf