OK, I have a form, ISForms, that I'm really using as a switchboard. The form has to pieces of selectable criteria: BA & SRType. You select from combo boxes the criteria for each, then click the form you want and, based on your criteria, a specific form (SRType) that w/ the records of the appropriate BA.
I have it working so that if you select a BA, it takes you to the appropriate records. What I don't know how to do is make it pick a form (there are 2 choices) from the selection you make. More over, really, I'm talking about having the code think through 2 different ideas to give a form back to you.
This is my code so far that just gives me BA-specific records. I need the ability to add to also select a specific record. There are 4 choices in the SRType list box. 3 of which, N/A, All SR's, and SR should take you to "SR Form". The 4th choice, Project, should take you to the form "SR-Project Form".
Code thus far:
-----
Private Sub SREdit_Click()
On Error GoTo Err_SREdit_Click
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.BA) Then
DoCmd.OpenForm "SR Form"
Exit Sub
End If
stDocName = "SR Form"
stLinkCriteria = "[BA]=" & "'" & Me![BA] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_SREdit_Click:
Exit Sub
Err_SREdit_Click:
MsgBox Err.Description
Resume Exit_SREdit_Click
End Sub
----
I have it working so that if you select a BA, it takes you to the appropriate records. What I don't know how to do is make it pick a form (there are 2 choices) from the selection you make. More over, really, I'm talking about having the code think through 2 different ideas to give a form back to you.
This is my code so far that just gives me BA-specific records. I need the ability to add to also select a specific record. There are 4 choices in the SRType list box. 3 of which, N/A, All SR's, and SR should take you to "SR Form". The 4th choice, Project, should take you to the form "SR-Project Form".
Code thus far:
-----
Private Sub SREdit_Click()
On Error GoTo Err_SREdit_Click
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.BA) Then
DoCmd.OpenForm "SR Form"
Exit Sub
End If
stDocName = "SR Form"
stLinkCriteria = "[BA]=" & "'" & Me![BA] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_SREdit_Click:
Exit Sub
Err_SREdit_Click:
MsgBox Err.Description
Resume Exit_SREdit_Click
End Sub
----