C
csulbw
I am trying to set the 'where' condition in vb by concatenating two
variables. If a check box on my form is checked, I want the condition to be
as indicated in the first procedure of the If statement below. The
[mgmt_unit_code] field is a text value indicating an organizational section
in an agency. For example, [mgmt_unit_code] may be "aa" or "aaa" or "aab".
This allows "sub levels" of the organization with "aaa" and "aab" being
subordinate to "aa". I want to be able to pull a single level or include
"sub levels" depending on the check box (i.e. "aa" or "aa*"). I've done this
before on other occasions, but for some reason I'm having a slow brain
today...
If Forms!frmAvailRes!chkRollup = -1 Then
strRollup = "*"
DoCmd.OpenReport "rptAvailLaborNotZero", acPreview, , "[mgmt_unit_code]
like " & strMU & strRollup
Else
DoCmd.OpenReport "rptAvailLaborNotZero", acPreview, , "[mgmt_unit_code]
like " & strMU
End If
The second condition works fine, but the first condition tells me there is
an extra ")" in the expression??? All insight is deeply appreciated.
variables. If a check box on my form is checked, I want the condition to be
as indicated in the first procedure of the If statement below. The
[mgmt_unit_code] field is a text value indicating an organizational section
in an agency. For example, [mgmt_unit_code] may be "aa" or "aaa" or "aab".
This allows "sub levels" of the organization with "aaa" and "aab" being
subordinate to "aa". I want to be able to pull a single level or include
"sub levels" depending on the check box (i.e. "aa" or "aa*"). I've done this
before on other occasions, but for some reason I'm having a slow brain
today...
If Forms!frmAvailRes!chkRollup = -1 Then
strRollup = "*"
DoCmd.OpenReport "rptAvailLaborNotZero", acPreview, , "[mgmt_unit_code]
like " & strMU & strRollup
Else
DoCmd.OpenReport "rptAvailLaborNotZero", acPreview, , "[mgmt_unit_code]
like " & strMU
End If
The second condition works fine, but the first condition tells me there is
an extra ")" in the expression??? All insight is deeply appreciated.