ORIGINAL SOURCE CODE FOR NEWUG.FRM
Made on Tuesday, Apr 8, 2003 at 9:43 AM
Option Explicit
'>>>>>>>>>>>>>>>>>>>>>>>>
'ResMe Converted To A Property: Const BUTTON1 = "&OK"
'ResMe Converted To A Property: Const BUTTON2 = "&Cancel"
'ResMe Converted To A Property: Const Label1 = "&Name:"
'ResMe Converted To A Property: Const Label2 = "&PID:"
'ResMe Converted To A Property: Const MSG1 = "PID must be between 4 and 20 characters!"
'>>>>>>>>>>>>>>>>>>>>>>>>
Public UserOrGroup As Integer
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error GoTo OKErr
Dim sTmp As String
Dim usr As User
Dim grp As Group
If Len(txtPID) < 4 Then
Beep
MsgBox MSG1, 48
Exit Sub
End If
If UserOrGroup = 0 Then
Set usr = gwsMainWS.CreateUser(txtName.Text, txtPID.Text)
gwsMainWS.Users.Append usr
gwsMainWS.Groups.Refresh
frmGroupsUsers.lstUsers.AddItem txtName.Text
frmGroupsUsers.lstGroupsUsers.AddItem txtName.Text
'add the new user to the Users group by default
On Error Resume Next 'just in case the users group is gone
gwsMainWS.Groups("Users").Users.Append usr
gwsMainWS.Users(txtName.Text).Groups.Refresh
Else
Set grp = gwsMainWS.CreateGroup(txtName.Text, txtPID.Text)
gwsMainWS.Groups.Append grp
gwsMainWS.Users.Refresh
frmGroupsUsers.lstGroups.AddItem txtName.Text
frmGroupsUsers.lstUsersGroups.AddItem txtName.Text
End If
Unload Me
Exit Sub
OKErr:
ShowError
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF1 And Shift = 0 Then
DisplayTopic 2016137
End If
End Sub
Private Sub Form_Load()
'ResMe autogenerated line of code to call the initialization routine that was automatically generated.
Call frmNewUserGroup_Auto_Init
cmdOK.Caption = BUTTON1
cmdCancel.Caption = BUTTON2
lblLabels(0).Caption = Label1
lblLabels(1).Caption = Label2
End Sub
Private Sub txtName_Change()
cmdOK.Enabled = Len(txtName.Text) > 0
End Sub
'*********************************************************************************
'** This Section Of Code Was Automatically Generated By ResMe **
'** **
'** String assignments to Constants have been converted to read-only properties **
'*********************************************************************************
'This was: Const BUTTON1 = "&OK"
Property Get BUTTON1 As String
BUTTON1 = "&OK"
End Property
'This was: Const BUTTON2 = "&Cancel"
Property Get BUTTON2 As String
BUTTON2 = "&Cancel"
End Property
'This was: Const Label1 = "&Name:"
Property Get Label1 As String
Label1 = "&Name:"
End Property
'This was: Const Label2 = "&PID:"
Property Get Label2 As String
Label2 = "&PID:"
End Property
'This was: Const MSG1 = "PID must be between 4 and 20 characters!"
Property Get MSG1 As String
MSG1 = "PID must be between 4 and 20 characters!"
End Property
Private Sub frmNewUserGroup_Auto_Init()
'This routine initializes all User Interface control properties on frmNewUserGroup.
'This section of code was automatically generated by the ResMe String Extraction Utility.
Me.Caption = "New User Group"
cmdCancel.Caption = "&Cancel"
cmdOK.Caption = "&OK"
lblLabels(1).Caption = "PID:"
lblLabels(0).Caption = "Name:"
End Sub