DCount problem 
Author Message
 DCount problem

I have tried it exactly as coded below but I receive a run-
time error 3075.  What does this mean and
what am I doing wrong?  The error is in the Life = DCount
line. Thanks

Sub PrintLife()

    'Count of Life Applications in Batch

    Dim Life As Integer
    Life = DCount("Mortgage Life Filter", "Application
Requests", _
    "[Printed] = True AND [Case Number] Is Not Null")

    'Print Life Applications

    Dim Msg, Style, Title, Response

    Msg = "Printing Mortgage Life Applications?" & vbCrLf
& Life & "Application(s)" & vbCrLf & "Click Yes when ready
or No to cancel!"
    Style = vbYesNo
   Title = "Print Mortgage Life"
    Response = MsgBox(Msg, Style, Title)

    If Response = vbYes Then
        DoCmd.OpenForm "Mortgage Life"
        DoCmd.RunCommand acCmdPrint
        DoCmd.Close acForm, "Mortgage Life"
    End If
End Sub



Sun, 09 May 2004 01:08:23 GMT  
 DCount problem
What's the error message, Jeff? I can't tell from the number, because:

? accesserror(3075)
|1 in query expression '|2'.

The "|1" and "|2" are placeholders that get filled in with further
information about the error when it occurs.
--

Brendan Reynolds


Quote:
> I have tried it exactly as coded below but I receive a run-
> time error 3075.  What does this mean and
> what am I doing wrong?  The error is in the Life = DCount
> line. Thanks

> Sub PrintLife()

>     'Count of Life Applications in Batch

>     Dim Life As Integer
>     Life = DCount("Mortgage Life Filter", "Application
> Requests", _
>     "[Printed] = True AND [Case Number] Is Not Null")

>     'Print Life Applications

>     Dim Msg, Style, Title, Response

>     Msg = "Printing Mortgage Life Applications?" & vbCrLf
> & Life & "Application(s)" & vbCrLf & "Click Yes when ready
> or No to cancel!"
>     Style = vbYesNo
>    Title = "Print Mortgage Life"
>     Response = MsgBox(Msg, Style, Title)

>     If Response = vbYes Then
>         DoCmd.OpenForm "Mortgage Life"
>         DoCmd.RunCommand acCmdPrint
>         DoCmd.Close acForm, "Mortgage Life"
>     End If
> End Sub



Sun, 09 May 2004 03:24:03 GMT  
 DCount problem
The error message reads:

"Run-Time error '3075':

Syntax error (missing operator) in query expression
'Count(Mortgage Life Filter)'

Thanks for your help!

Quote:
>-----Original Message-----
>What's the error message, Jeff? I can't tell from the
number, because:

>? accesserror(3075)
>|1 in query expression '|2'.

>The "|1" and "|2" are placeholders that get filled in
with further
>information about the error when it occurs.
>--

>Brendan Reynolds



>> I have tried it exactly as coded below but I receive a
run-
>> time error 3075.  What does this mean and
>> what am I doing wrong?  The error is in the Life =
DCount
>> line. Thanks

>> Sub PrintLife()

>>     'Count of Life Applications in Batch

>>     Dim Life As Integer
>>     Life = DCount("Mortgage Life Filter", "Application
>> Requests", _
>>     "[Printed] = True AND [Case Number] Is Not Null")

>>     'Print Life Applications

>>     Dim Msg, Style, Title, Response

>>     Msg = "Printing Mortgage Life Applications?" &
vbCrLf
>> & Life & "Application(s)" & vbCrLf & "Click Yes when
ready
>> or No to cancel!"
>>     Style = vbYesNo
>>    Title = "Print Mortgage Life"
>>     Response = MsgBox(Msg, Style, Title)

>>     If Response = vbYes Then
>>         DoCmd.OpenForm "Mortgage Life"
>>         DoCmd.RunCommand acCmdPrint
>>         DoCmd.Close acForm, "Mortgage Life"
>>     End If
>> End Sub

>.



Sun, 09 May 2004 03:37:31 GMT  
 DCount problem
The error message reads:

"Run-Time error '3075':

Syntax error (missing operator) in query expression
'Count(Mortgage Life Filter)'

Thanks for your help!

Quote:
>-----Original Message-----
>What's the error message, Jeff? I can't tell from the
number, because:

>? accesserror(3075)
>|1 in query expression '|2'.

>The "|1" and "|2" are placeholders that get filled in
with further
>information about the error when it occurs.
>--

>Brendan Reynolds



>> I have tried it exactly as coded below but I receive a
run-
>> time error 3075.  What does this mean and
>> what am I doing wrong?  The error is in the Life =
DCount
>> line. Thanks

>> Sub PrintLife()

>>     'Count of Life Applications in Batch

>>     Dim Life As Integer
>>     Life = DCount("Mortgage Life Filter", "Application
>> Requests", _
>>     "[Printed] = True AND [Case Number] Is Not Null")

>>     'Print Life Applications

>>     Dim Msg, Style, Title, Response

>>     Msg = "Printing Mortgage Life Applications?" &
vbCrLf
>> & Life & "Application(s)" & vbCrLf & "Click Yes when
ready
>> or No to cancel!"
>>     Style = vbYesNo
>>    Title = "Print Mortgage Life"
>>     Response = MsgBox(Msg, Style, Title)

>>     If Response = vbYes Then
>>         DoCmd.OpenForm "Mortgage Life"
>>         DoCmd.RunCommand acCmdPrint
>>         DoCmd.Close acForm, "Mortgage Life"
>>     End If
>> End Sub

>.



Sun, 09 May 2004 03:37:44 GMT  
 DCount problem
Well, as the phrase 'Count(Mortgage Life Filter)' doesn't appear anywhere in
the code you posted, I'm guessing that 'Application Requests' is a query,
and that the error is actually in the query and not the code. I think it's
probably the spaces in the field name. I never use spaces in field names
myself, so I find it difficult to remember exactly where and when they will
cause problems.

--

Brendan Reynolds


Quote:
> The error message reads:

> "Run-Time error '3075':

> Syntax error (missing operator) in query expression
> 'Count(Mortgage Life Filter)'

> Thanks for your help!

> >-----Original Message-----
> >What's the error message, Jeff? I can't tell from the
> number, because:

> >? accesserror(3075)
> >|1 in query expression '|2'.

> >The "|1" and "|2" are placeholders that get filled in
> with further
> >information about the error when it occurs.
> >--

> >Brendan Reynolds



> >> I have tried it exactly as coded below but I receive a
> run-
> >> time error 3075.  What does this mean and
> >> what am I doing wrong?  The error is in the Life =
> DCount
> >> line. Thanks

> >> Sub PrintLife()

> >>     'Count of Life Applications in Batch

> >>     Dim Life As Integer
> >>     Life = DCount("Mortgage Life Filter", "Application
> >> Requests", _
> >>     "[Printed] = True AND [Case Number] Is Not Null")

> >>     'Print Life Applications

> >>     Dim Msg, Style, Title, Response

> >>     Msg = "Printing Mortgage Life Applications?" &
> vbCrLf
> >> & Life & "Application(s)" & vbCrLf & "Click Yes when
> ready
> >> or No to cancel!"
> >>     Style = vbYesNo
> >>    Title = "Print Mortgage Life"
> >>     Response = MsgBox(Msg, Style, Title)

> >>     If Response = vbYes Then
> >>         DoCmd.OpenForm "Mortgage Life"
> >>         DoCmd.RunCommand acCmdPrint
> >>         DoCmd.Close acForm, "Mortgage Life"
> >>     End If
> >> End Sub

> >.



Sun, 09 May 2004 03:51:53 GMT  
 DCount problem
This is a guess but is "True" a string? Are you trying to locate 1's or 0's?
You may have to place a quotes around that, like "[Printed]=""""True""""
AND...

Just a guess

Scott

Quote:
>     Dim Life As Integer
>     Life = DCount("Mortgage Life Filter", "Application
> Requests", _
>     "[Printed] = True AND [Case Number] Is Not Null")

>     'Print Life Applications

>     Dim Msg, Style, Title, Response

>     Msg = "Printing Mortgage Life Applications?" & vbCrLf
> & Life & "Application(s)" & vbCrLf & "Click Yes when ready
> or No to cancel!"
>     Style = vbYesNo
>    Title = "Print Mortgage Life"
>     Response = MsgBox(Msg, Style, Title)

>     If Response = vbYes Then
>         DoCmd.OpenForm "Mortgage Life"
>         DoCmd.RunCommand acCmdPrint
>         DoCmd.Close acForm, "Mortgage Life"
>     End If
> End Sub



Sun, 09 May 2004 07:25:29 GMT  
 DCount problem
Jeff:

Just a quick interjection here. Try:

Life = DCount("[Mortgage Life Filter]", "[Application Requests]", _
    "[Printed] = True AND [Case Number] Is Not Null")

--
Bruce M. Thompson, Microsoft Access MVP

Quote:
>>No Email, Please. Keep all communications

    within the newsgroups so that all might benefit.<<


Quote:
> I have tried it exactly as coded below but I receive a run-
> time error 3075.  What does this mean and
> what am I doing wrong?  The error is in the Life = DCount
> line. Thanks

> Sub PrintLife()

>     'Count of Life Applications in Batch

>     Dim Life As Integer
>     Life = DCount("Mortgage Life Filter", "Application
> Requests", _
>     "[Printed] = True AND [Case Number] Is Not Null")

>     'Print Life Applications

>     Dim Msg, Style, Title, Response

>     Msg = "Printing Mortgage Life Applications?" & vbCrLf
> & Life & "Application(s)" & vbCrLf & "Click Yes when ready
> or No to cancel!"
>     Style = vbYesNo
>    Title = "Print Mortgage Life"
>     Response = MsgBox(Msg, Style, Title)

>     If Response = vbYes Then
>         DoCmd.OpenForm "Mortgage Life"
>         DoCmd.RunCommand acCmdPrint
>         DoCmd.Close acForm, "Mortgage Life"
>     End If
> End Sub



Sun, 09 May 2004 07:29:11 GMT  
 DCount problem
I figured it out, I feel so stupid, I had Mortgage Life
Filter instead of MortgageLifeFilter for the expr.  Thanks

Quote:
>-----Original Message-----
>Well, as the phrase 'Count(Mortgage Life Filter)' doesn't
appear anywhere in
>the code you posted, I'm guessing that 'Application

Requests' is a query,
Quote:
>and that the error is actually in the query and not the
code. I think it's
>probably the spaces in the field name. I never use spaces
in field names
>myself, so I find it difficult to remember exactly where
and when they will
>cause problems.

>--

>Brendan Reynolds



>> The error message reads:

>> "Run-Time error '3075':

>> Syntax error (missing operator) in query expression
>> 'Count(Mortgage Life Filter)'

>> Thanks for your help!

>> >-----Original Message-----
>> >What's the error message, Jeff? I can't tell from the
>> number, because:

>> >? accesserror(3075)
>> >|1 in query expression '|2'.

>> >The "|1" and "|2" are placeholders that get filled in
>> with further
>> >information about the error when it occurs.
>> >--

>> >Brendan Reynolds



>> >> I have tried it exactly as coded below but I receive
a
>> run-
>> >> time error 3075.  What does this mean and
>> >> what am I doing wrong?  The error is in the Life =
>> DCount
>> >> line. Thanks

>> >> Sub PrintLife()

>> >>     'Count of Life Applications in Batch

>> >>     Dim Life As Integer
>> >>     Life = DCount("Mortgage Life

Filter", "Application

- Show quoted text -

Quote:
>> >> Requests", _
>> >>     "[Printed] = True AND [Case Number] Is Not Null")

>> >>     'Print Life Applications

>> >>     Dim Msg, Style, Title, Response

>> >>     Msg = "Printing Mortgage Life Applications?" &
>> vbCrLf
>> >> & Life & "Application(s)" & vbCrLf & "Click Yes when
>> ready
>> >> or No to cancel!"
>> >>     Style = vbYesNo
>> >>    Title = "Print Mortgage Life"
>> >>     Response = MsgBox(Msg, Style, Title)

>> >>     If Response = vbYes Then
>> >>         DoCmd.OpenForm "Mortgage Life"
>> >>         DoCmd.RunCommand acCmdPrint
>> >>         DoCmd.Close acForm, "Mortgage Life"
>> >>     End If
>> >> End Sub

>> >.

>.



Sun, 09 May 2004 23:29:59 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. DCount - Problems

2. DCOUNT divided by DCOUNT

3. Help with DCOUNT overflow problem

4. Dcount VBA syntax problem

5. DCount and Date Problem

6. Problems with DCount function

7. Dcount function - need help with the criteria part!

8. dcount or counting records code?

9. Dsum and Dcount syntax

10. DCount question

11. sql dcount criteria syntax missing operator

12. Dcount

 

 
Powered by phpBB® Forum Software