Re: The Object Doesn't contain the Automation object 'Date'



Hi Brendan

Thanks for replying again.

My code is now the following

=DCount("Reference Number","Newsletter Database",Year(Date()) & " -
[Year Born] Between " & 18 & " And " & 25)

I'm getting no error message but the text box is saying #Name?

Thanks again

Colin
Brendan Reynolds wrote:
If you're having trouble entering the expression without the square brackets
around 'Date' try entering it as 'Date()', e.g. ...

=DCount("Reference Number","Newsletter Database",Year(Date()) & " - [Year
Born] Between " & 18 & " And " & 25)

You may find that Access removes the parentheses after Date, but they should
be enough to prevent Access from adding the square brackets.

If that still doesn't solve your problem, can you post your expression as it
looks now, with the square brackets removed, and can you also clarify
whether you are still getting the same error message or a different one?

--
Brendan Reynolds
Access MVP


<weircolin@xxxxxxxxxxxxxx> wrote in message
news:1156422537.832955.54430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi

Thanks for your reply. One of the problems is that the square brackets
appear themselves! When I take them away it still doesn't work.

Thanks

Colin
Brendan Reynolds wrote:
The square brackets indicate that 'Date' is a control or property of your
form. If you intended to refer to the Date function, remove the square
brackets.

--
Brendan Reynolds
Access MVP


<weircolin@xxxxxxxxxxxxxx> wrote in message
news:1156417608.243792.226970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi

I am getting the following message up

You tried to runa Visual Basic Proceedure to set a property or method
for an object, however, the component doesn't make the property or
method available for automation operations.


Check the component's documentation for information on the properties
and methods it make available for Automation operations.

When I try to use the code

=DCount("Reference Number","Newsletter Database",Year([Date]) & " -
[Year Born] Between " & 18 & " And " & 25)

Does anyone have any ideas!?

Thanks

Colin



.



Relevant Pages

  • Re: The Object Doesnt contain the Automation object Date
    ... Ironically enough, you probably need to *add* some square brackets, around ... I'm getting no error message but the text box is saying #Name? ... Brendan Reynolds wrote: ... and methods it make available for Automation operations. ...
    (microsoft.public.access.formscoding)
  • Re: The Object Doesnt contain the Automation object Date
    ... One of the problems is that the square brackets ... Brendan Reynolds wrote: ... You tried to runa Visual Basic Proceedure to set a property or method ... and methods it make available for Automation operations. ...
    (microsoft.public.access.formscoding)
  • Re: The Object Doesnt contain the Automation object Date
    ... Brendan Reynolds wrote: ... I'm getting no error message but the text box is saying #Name? ... be enough to prevent Access from adding the square brackets. ... and methods it make available for Automation operations. ...
    (microsoft.public.access.formscoding)
  • Re: The Object Doesnt contain the Automation object Date
    ... If you're having trouble entering the expression without the square brackets ... You may find that Access removes the parentheses after Date, ... Brendan Reynolds wrote: ... and methods it make available for Automation operations. ...
    (microsoft.public.access.formscoding)
  • Re: Access VBA update recordset error
    ... full text of the error message might help, ... Brendan Reynolds ... >I am using the exact same syntax and it gives me a syntax error message ... >> GlobalSign digital certificate is a forgery and should be deleted without ...
    (microsoft.public.data.ado)