G
Guest
Hi
I'm trying to use the DoCmd.open query statement to run a Select query. The
query has a function which captures input from a form. The query and the
code executed properly as long as the input is simple, but I run into
problems when the input is a composite one. The same thing works ok if I run
it through a report (using docmd.openreport command). Please help - I'm
attaching the and the relevant function below:
Function bu() As String
Dim strsql As String
If Forms!frmPreconsensus1!txtBU = "Core" Then
bu = "W"
ElseIf Forms!frmPreconsensus1!txtBU = "NCB" Then
bu = "K"
Else
bu = "'*'" 'This is where I'm runnning into a problem. I've tried
using like *, 'W' or 'K', etc.
End If
End Function
Can someone tell me wat I'm doing wrong or suggegst an alternate way of
accomplishing this? Thanks
I'm trying to use the DoCmd.open query statement to run a Select query. The
query has a function which captures input from a form. The query and the
code executed properly as long as the input is simple, but I run into
problems when the input is a composite one. The same thing works ok if I run
it through a report (using docmd.openreport command). Please help - I'm
attaching the and the relevant function below:
Function bu() As String
Dim strsql As String
If Forms!frmPreconsensus1!txtBU = "Core" Then
bu = "W"
ElseIf Forms!frmPreconsensus1!txtBU = "NCB" Then
bu = "K"
Else
bu = "'*'" 'This is where I'm runnning into a problem. I've tried
using like *, 'W' or 'K', etc.
End If
End Function
Can someone tell me wat I'm doing wrong or suggegst an alternate way of
accomplishing this? Thanks