D
Dan
I have an access database that links in some SQL tables. There is a form
where end users select options for what they want to display. Once an option
button is selected the text box associated with it is enabled and they can
enter in thier criteria. I have this working for two but can not get the
third. I am sure it has to do with the format the code I have is as follows:
Private Sub Command5_Click()
Dim a As String
Dim CritS As String
Dim CritW As String
Dim CritO As String
CritS = "SELECT PostJobs.COMPL_DTE_OJB AS [Comp], PostJobs.ORDER_NO_OJB AS
[Order], PostJobs.JOB_SEQ_NO_OJB, PostJobs.JOB_NO_OJB AS Job,
PostJobs.JOB_TYP_OJB AS Type, PostJobs.IR_TECH_OJB AS Tech,
PostJobs.QC_STATUS, PostJobs.QC_REP, PostJobs.QC_DATE FROM PostJobs "
CritO = "ORDER BY PostJobs.IR_TECH_OJB, PostJobs.COMPL_DTE_OJB; "
If Me.Option6 Or Me.Option9 Then
' CritW = "WHERE (((PostJobs.IR_TECH_OJB) = '" & Me.Text3 & "') And
((PostJobs.COMPL_DTE_OJB) = #" & Me.Text8 & "#))"
' If Me.Option9 = False Then ' TEXT FIELD
' CritW = "WHERE (((PostJobs.IR_TECH_OJB)='" & Me.Text3 & "')) "
' End If
' If Me.Option6 = False Then 'DATE FIELD
' CritW = "WHERE (((PostJobs.COMPL_DTE_OJB) = #" & Me.Text8 & "#)) "
' End If
If Me.Option13 = True Then 'Number Field
CritW = "WHERE (((PostJobs.JOB_NO_OJB)='" & Me.Text12 & "')) "
End If
'End If
Me.List0.RowSource = CritS & CritW & CritO
End Sub
If I use the CritW options for the other 2 and still use Text12 it works, I
know, or strongly feel, its the format for the number field, but I'll be
buggered if I can find it. It's probably simply and I am over thinking it.
Thanks for the help in advance
where end users select options for what they want to display. Once an option
button is selected the text box associated with it is enabled and they can
enter in thier criteria. I have this working for two but can not get the
third. I am sure it has to do with the format the code I have is as follows:
Private Sub Command5_Click()
Dim a As String
Dim CritS As String
Dim CritW As String
Dim CritO As String
CritS = "SELECT PostJobs.COMPL_DTE_OJB AS [Comp], PostJobs.ORDER_NO_OJB AS
[Order], PostJobs.JOB_SEQ_NO_OJB, PostJobs.JOB_NO_OJB AS Job,
PostJobs.JOB_TYP_OJB AS Type, PostJobs.IR_TECH_OJB AS Tech,
PostJobs.QC_STATUS, PostJobs.QC_REP, PostJobs.QC_DATE FROM PostJobs "
CritO = "ORDER BY PostJobs.IR_TECH_OJB, PostJobs.COMPL_DTE_OJB; "
If Me.Option6 Or Me.Option9 Then
' CritW = "WHERE (((PostJobs.IR_TECH_OJB) = '" & Me.Text3 & "') And
((PostJobs.COMPL_DTE_OJB) = #" & Me.Text8 & "#))"
' If Me.Option9 = False Then ' TEXT FIELD
' CritW = "WHERE (((PostJobs.IR_TECH_OJB)='" & Me.Text3 & "')) "
' End If
' If Me.Option6 = False Then 'DATE FIELD
' CritW = "WHERE (((PostJobs.COMPL_DTE_OJB) = #" & Me.Text8 & "#)) "
' End If
If Me.Option13 = True Then 'Number Field
CritW = "WHERE (((PostJobs.JOB_NO_OJB)='" & Me.Text12 & "')) "
End If
'End If
Me.List0.RowSource = CritS & CritW & CritO
End Sub
If I use the CritW options for the other 2 and still use Text12 it works, I
know, or strongly feel, its the format for the number field, but I'll be
buggered if I can find it. It's probably simply and I am over thinking it.
Thanks for the help in advance