G
Guest
I'm making an org chart style form using cmd btns for each org. When the org
is clicked, it opens a filtered datasheet for the people in that org. Some
orgs need only one parameter, some need two to define the people (Group and
Offc). I made two text boxes for the form to hold and read the values (text
44 and 46). I can probably figure out how to do away with using the text
boxes (I build up subs slowly to see what goes on), but if you could
recommend a shorter way to list the On_Click subs for the fifty or so orgs?
I only put two in this example, one showing the Group value and another
showing the Group and Offc value. Would you call the ShowMembers sub or do
it another way? Learning to code so be nice...Thanks.
Public strGroup As String
Public strOffc As String
Private Sub Form_AfterUpdate()
Text44.Value = ""
Text46.Value = ""
End Sub
Private Sub Command3_Click()
Text44.Value = "ARW"
strGroup = Text44.Value
Call ShowMembers
End Sub
Private Sub Command10_Click()
Text44.Value = "MSG"
Text46.Value = "EM"
strGroup = Text44.Value
strOffc = Text46.Value
Call ShowMembers
End Sub
Private Sub ShowMembers()
Dim stDocName As String
Text44.Value = ""
Text46.Value = ""
Debug.Print strGroup, strOffc
stDocName = "frmOrgChtsub"
If strOffc = "" Then
DoCmd.OpenForm stDocName, acFormDS, , "[group]= '" & strGroup & "'"
Else
DoCmd.OpenForm stDocName, acFormDS, , "[group]= '" & strGroup & "'"
& "AND" & "[office_symbol]= '" & strOffc & "'"
End If
strGroup = ""
strOffc = ""
End Sub
is clicked, it opens a filtered datasheet for the people in that org. Some
orgs need only one parameter, some need two to define the people (Group and
Offc). I made two text boxes for the form to hold and read the values (text
44 and 46). I can probably figure out how to do away with using the text
boxes (I build up subs slowly to see what goes on), but if you could
recommend a shorter way to list the On_Click subs for the fifty or so orgs?
I only put two in this example, one showing the Group value and another
showing the Group and Offc value. Would you call the ShowMembers sub or do
it another way? Learning to code so be nice...Thanks.
Public strGroup As String
Public strOffc As String
Private Sub Form_AfterUpdate()
Text44.Value = ""
Text46.Value = ""
End Sub
Private Sub Command3_Click()
Text44.Value = "ARW"
strGroup = Text44.Value
Call ShowMembers
End Sub
Private Sub Command10_Click()
Text44.Value = "MSG"
Text46.Value = "EM"
strGroup = Text44.Value
strOffc = Text46.Value
Call ShowMembers
End Sub
Private Sub ShowMembers()
Dim stDocName As String
Text44.Value = ""
Text46.Value = ""
Debug.Print strGroup, strOffc
stDocName = "frmOrgChtsub"
If strOffc = "" Then
DoCmd.OpenForm stDocName, acFormDS, , "[group]= '" & strGroup & "'"
Else
DoCmd.OpenForm stDocName, acFormDS, , "[group]= '" & strGroup & "'"
& "AND" & "[office_symbol]= '" & strOffc & "'"
End If
strGroup = ""
strOffc = ""
End Sub