I have a 2 forms.
One form EnterScores, is my main form where a user can enter, update, or view a record and its data(fields).
I have created 3 macros to open additional forms for analysis purposes. On the form EnterScores, I have a combo box which allows the user to select one of the 3 forms. I also have a button on the form which I have added VB code to.
The code for the button opens the one of the 3 forms depending on which name was selected in the combo box.
Basically the user selects one of the 3 forms names from the combo box then clicks on the button and the desired form opens.
What I want to do is this:
I have 10 records and I scroll through the navigation buttons to the 5th record on the EnterScores form. I now want to view one of my analysis forms (one of the 3 forms the user can select from the combo box) and have the forms that opens, open straight to that 5th record.
How can I connect the form I am opening to the main form? Can I add some VB code to my 'on click' event to connect the two?
Thanks!
Here is my code:
Private Sub btnGo_Click()
On Error GoTo Err_btnMacro_Click
Dim stDocName As String
If txtFromSelection = "Past Rounds" Then
stDocName = "OpenFormPastRounds"
DoCmd.RunMacro stDocName
ElseIf txtFormSelection = "Scoring Breakdown" Then
stDocName = "OpenFormScoringBreakdown"
DoCmd.RunMacro stDocName
ElseIf txtFormSelection = "Round Statistics" Then
stDocName = "OpenFormRoundStatistics"
DoCmd.RunMacro stDocName
End If
Exit_btnMacro_Click:
Exit Sub
Err_btnMacro_Click:
MsgBox Err.Description
Resume Exit_btnMacro_Click
End Sub
Cheers,
JJB373
One form EnterScores, is my main form where a user can enter, update, or view a record and its data(fields).
I have created 3 macros to open additional forms for analysis purposes. On the form EnterScores, I have a combo box which allows the user to select one of the 3 forms. I also have a button on the form which I have added VB code to.
The code for the button opens the one of the 3 forms depending on which name was selected in the combo box.
Basically the user selects one of the 3 forms names from the combo box then clicks on the button and the desired form opens.
What I want to do is this:
I have 10 records and I scroll through the navigation buttons to the 5th record on the EnterScores form. I now want to view one of my analysis forms (one of the 3 forms the user can select from the combo box) and have the forms that opens, open straight to that 5th record.
How can I connect the form I am opening to the main form? Can I add some VB code to my 'on click' event to connect the two?
Thanks!
Here is my code:
Private Sub btnGo_Click()
On Error GoTo Err_btnMacro_Click
Dim stDocName As String
If txtFromSelection = "Past Rounds" Then
stDocName = "OpenFormPastRounds"
DoCmd.RunMacro stDocName
ElseIf txtFormSelection = "Scoring Breakdown" Then
stDocName = "OpenFormScoringBreakdown"
DoCmd.RunMacro stDocName
ElseIf txtFormSelection = "Round Statistics" Then
stDocName = "OpenFormRoundStatistics"
DoCmd.RunMacro stDocName
End If
Exit_btnMacro_Click:
Exit Sub
Err_btnMacro_Click:
MsgBox Err.Description
Resume Exit_btnMacro_Click
End Sub
Cheers,
JJB373