Access.2007.VBA.Bibl..

(John Hannent) #1
FIGURE 6.20
A Word document with Access data displayed in bookmarks.

Check that at least one contact has been selected:

Set lst = Me![lstSelectContacts]

If lst.ItemsSelected.Count = 0 Then
MsgBox “Please select at least one contact”
lst.SetFocus
GoTo ErrorHandlerExit
End If

intColumns = lst.ColumnCount
intRows = lst.ItemsSelected.Count

For Each varItem In lst.ItemsSelected

Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf