W
WestWingFan
Thank you in advance for any help or advice. I'm trying to do something which
shouldn't be too hard, but has me stumped. I suspect it has something to do
with where the code is placed. In case it matters, I'm using 2007 to design a
2000 file format.
My first form has a command button. When the command button is clicked I
would like a second form (based on query) to open and be filtered (by combo
box)displaying the indicated set of records.
So, form 1 code:
Private Sub btnGroup1_Click()
On Error GoTo Err_btnOpenGroup1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmConvActivRtgGrp1"
stLinkCriteria = "[GroupID] =" & 1
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
Exit_btnOpenGroup1_Click:
Exit Sub
Err_btnOpenGroup1_Click:
MsgBox Err.Description
Resume Exit_btnOpenGroup1_Click
End Sub
Form 2 code:
Private Sub Form_Load()
DoCmd.Maximize
Me.Filter = "[JCTARCourse] = " & "'" & cboTARselect1 & "'"
Me.FilterOn = True
Me.sbfrmAnalystClarityList.Requery
Me.sbfrmConvActRtg.Requery
'Me.sbfrmConvActRtg.SetFocus
'Me.sbfrmConvActRtg.Form.[ConvActivityRating].SetFocus
End Sub
Any help would be appreciated.
shouldn't be too hard, but has me stumped. I suspect it has something to do
with where the code is placed. In case it matters, I'm using 2007 to design a
2000 file format.
My first form has a command button. When the command button is clicked I
would like a second form (based on query) to open and be filtered (by combo
box)displaying the indicated set of records.
So, form 1 code:
Private Sub btnGroup1_Click()
On Error GoTo Err_btnOpenGroup1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmConvActivRtgGrp1"
stLinkCriteria = "[GroupID] =" & 1
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
Exit_btnOpenGroup1_Click:
Exit Sub
Err_btnOpenGroup1_Click:
MsgBox Err.Description
Resume Exit_btnOpenGroup1_Click
End Sub
Form 2 code:
Private Sub Form_Load()
DoCmd.Maximize
Me.Filter = "[JCTARCourse] = " & "'" & cboTARselect1 & "'"
Me.FilterOn = True
Me.sbfrmAnalystClarityList.Requery
Me.sbfrmConvActRtg.Requery
'Me.sbfrmConvActRtg.SetFocus
'Me.sbfrmConvActRtg.Form.[ConvActivityRating].SetFocus
End Sub
Any help would be appreciated.