HandsOn Creating a Group Account

1. Switch to the Visual Basic Editor window and insert a new module.

2. In the module's Code window, enter the CreateGroupAccount procedure as shown below.

Sub CreateGroupAccount()

Dim conn As ADODB.Connection

On Error GoTo ErrorHandler

Set conn = CurrentProject.Connection conn.Execute "CREATE GROUP Mozart 2001Best" ExitHere:

If Not conn Is Nothing Then

If conn.State = adStateOpen Then conn.Close

Part III

End If

Set conn = Nothing Exit Sub ErrorHandler:

MsgBox Err.Number & ":" & Err.Description Resume ExitHere End Sub

0 0

Post a comment