R
RobUCSD via AccessMonster.com
I'm trying to instert the following in the criteria section of a query in
query builder; the itself is the record source for a list box
*******************************************************************************************************
If Forms!frmPtDemographicNew.frmVisitNewEdit.Form!fldVisitType = "Ablation"
Then
Me.lstRNnotesLU.RowSource = "SELECT * FROM tblRNnotesLU " & _
"WHERE fldRNnotesCode = 'A'" & "ORDER BY [fld.order]"
Else: If Forms!frmPtDemographicNew.frmVisitNewEdit.Form!fldVisitType
= "Device" Then
Me.lstRNnotesLU.RowSource = "SELECT * FROM tblRNnotesLU "
& _
"WHERE fldRNnotesCode = 'D'" & "ORDER BY [fld.order]
"
End If
End If
****************************************************************************************************
I started this by placing it in the onOpen event of the form, but then I
realized I don't want to hard code this in the form. I'd rather to just be
able to do it within a query. Then if I add new VisitTypes I can simply
modify the query without touching the code in the form.
I know my criteria statement is wrong, therefore your help is greatly
appreciated. Rob
query builder; the itself is the record source for a list box
*******************************************************************************************************
If Forms!frmPtDemographicNew.frmVisitNewEdit.Form!fldVisitType = "Ablation"
Then
Me.lstRNnotesLU.RowSource = "SELECT * FROM tblRNnotesLU " & _
"WHERE fldRNnotesCode = 'A'" & "ORDER BY [fld.order]"
Else: If Forms!frmPtDemographicNew.frmVisitNewEdit.Form!fldVisitType
= "Device" Then
Me.lstRNnotesLU.RowSource = "SELECT * FROM tblRNnotesLU "
& _
"WHERE fldRNnotesCode = 'D'" & "ORDER BY [fld.order]
"
End If
End If
****************************************************************************************************
I started this by placing it in the onOpen event of the form, but then I
realized I don't want to hard code this in the form. I'd rather to just be
able to do it within a query. Then if I add new VisitTypes I can simply
modify the query without touching the code in the form.
I know my criteria statement is wrong, therefore your help is greatly
appreciated. Rob