I have a form that has an option group at the top called framemissing. With each selection from the option group, I would like my subform called qmissing to display records from the query created with each selection from the option group. In the properties for framemissing, I have an afterupdate routine as follows:
Private Sub FrameMissing_AfterUpdate()
Dim strsql As String
Select Case FrameMissing
Case 1
strsql = "SELECT * FROM [Head Count] WHERE 1=1 AND [Head Count].[Budgeted CC] In ("");"
Case 2
strsql = "SELECT * FROM [Head Count] WHERE 1=1 AND [Head Count].[Budgeted Annual Salary] In (0);"
Case 3
strsql = "SELECT * FROM [Head Count] WHERE (((1)=1) AND (([Head Count].[Budgeted Start]) Is Null));"
Case 4
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND [Job Activity].[Act Cost Center] In ("");"
Case 5
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND [Job Activity].[Act Annual Salary] In (0);"
Case 6
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND (([Job Activity].[Act Start Date]) Is Null));"
Case 7
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND (([Job Activity].[FC Start Date]) Is Null));"
Case 8
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND [Job Activity].[FC Annual Salary] In (0);"
End Select
Me.QMissing.Form.RecordSource = strsql
End Sub
Obviously this isn't working or I wouldn't be posting however I do not have anything listed in the recordsource for the subform since I would like the option group to determine that. I'm a little confused about the properties for the subform. I know that there is the qmissing properties and the source object is listed as qmissing. Then you can click in the upper left corner and it selects a form that you can put a record source in the properties. this is blank right now. clearly I don't understand the difference between the two. Any ideas? Thanks!
Private Sub FrameMissing_AfterUpdate()
Dim strsql As String
Select Case FrameMissing
Case 1
strsql = "SELECT * FROM [Head Count] WHERE 1=1 AND [Head Count].[Budgeted CC] In ("");"
Case 2
strsql = "SELECT * FROM [Head Count] WHERE 1=1 AND [Head Count].[Budgeted Annual Salary] In (0);"
Case 3
strsql = "SELECT * FROM [Head Count] WHERE (((1)=1) AND (([Head Count].[Budgeted Start]) Is Null));"
Case 4
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND [Job Activity].[Act Cost Center] In ("");"
Case 5
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND [Job Activity].[Act Annual Salary] In (0);"
Case 6
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND (([Job Activity].[Act Start Date]) Is Null));"
Case 7
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND (([Job Activity].[FC Start Date]) Is Null));"
Case 8
strsql = "SELECT * FROM [Job Activity] WHERE 1=1 AND [Job Activity].[FC Annual Salary] In (0);"
End Select
Me.QMissing.Form.RecordSource = strsql
End Sub
Obviously this isn't working or I wouldn't be posting however I do not have anything listed in the recordsource for the subform since I would like the option group to determine that. I'm a little confused about the properties for the subform. I know that there is the qmissing properties and the source object is listed as qmissing. Then you can click in the upper left corner and it selects a form that you can put a record source in the properties. this is blank right now. clearly I don't understand the difference between the two. Any ideas? Thanks!