functions in queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a function and am calling it from a query as an expression.
When I run the query all is fine but when I run the report that uses the
query I am told that it can not find the macro PreadScreenTime([event_sysid])
which is the function that I am useing. Why is it looking for a macro when
it is clearly a function that is being used? The report asks for the data of
the function by the name of the field in the query. The field is labled as:
PreAdScreen: PreAdScreenTime([event_sysid]). Thanks
 
Where is the function? It must be in a module (not a module associated with
a form, nor a class). As well, make sure it isn't declared as Private.
 
The function is in a module with many other functions that are used by the
dbase. It is declared as Public.

Douglas J. Steele said:
Where is the function? It must be in a module (not a module associated with
a form, nor a class). As well, make sure it isn't declared as Private.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


bindurajeesh said:
I have created a function and am calling it from a query as an expression.
When I run the query all is fine but when I run the report that uses the
query I am told that it can not find the macro
PreadScreenTime([event_sysid])
which is the function that I am useing. Why is it looking for a macro
when
it is clearly a function that is being used? The report asks for the data
of
the function by the name of the field in the query. The field is labled
as:
PreAdScreen: PreAdScreenTime([event_sysid]). Thanks
 
The only other things that occur to me is that you've mistyped the function
name, or else you somehow have a macro with the same name as the function.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


bindurajeesh said:
The function is in a module with many other functions that are used by the
dbase. It is declared as Public.

Douglas J. Steele said:
Where is the function? It must be in a module (not a module associated
with
a form, nor a class). As well, make sure it isn't declared as Private.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


bindurajeesh said:
I have created a function and am calling it from a query as an
expression.
When I run the query all is fine but when I run the report that uses
the
query I am told that it can not find the macro
PreadScreenTime([event_sysid])
which is the function that I am useing. Why is it looking for a macro
when
it is clearly a function that is being used? The report asks for the
data
of
the function by the name of the field in the query. The field is
labled
as:
PreAdScreen: PreAdScreenTime([event_sysid]). Thanks
 
PreAdScreen: PreAdScreenTime([event_sysid]).

PreAdScreen: =PreAdScreenTime([event_sysid]).

Note the unexpected requirement for an "=" sign embedded in
the data source declaration. Access uses the "=" sign to
indicate that a VBA function is called.

(~: Grin for Douglas who missed that :~)

(david)
 
Say what, David?

I assumed that PreAdScreen: PreAdScreenTime([event_sysid]) was typed into a
cell on the field row of the graphical query builder. You certainly don't
need to include an = sign there.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


PreAdScreen: PreAdScreenTime([event_sysid]).

PreAdScreen: =PreAdScreenTime([event_sysid]).

Note the unexpected requirement for an "=" sign embedded in
the data source declaration. Access uses the "=" sign to
indicate that a VBA function is called.

(~: Grin for Douglas who missed that :~)

(david)


bindurajeesh said:
I have created a function and am calling it from a query as an
expression.
When I run the query all is fine but when I run the report that uses the
query I am told that it can not find the macro PreadScreenTime([event_sysid])
which is the function that I am useing. Why is it looking for a macro when
it is clearly a function that is being used? The report asks for the
data of
the function by the name of the field in the query. The field is labled as:
PreAdScreen: PreAdScreenTime([event_sysid]). Thanks
 
My frequent errors are a result of my light hearted
approach to the forums :~)

My next suggestion is that he is using "Sorting and Breaking"
on the calculated field.

:~)

(david)


Douglas J. Steele said:
Say what, David?

I assumed that PreAdScreen: PreAdScreenTime([event_sysid]) was typed into
a cell on the field row of the graphical query builder. You certainly
don't need to include an = sign there.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


PreAdScreen: PreAdScreenTime([event_sysid]).

PreAdScreen: =PreAdScreenTime([event_sysid]).

Note the unexpected requirement for an "=" sign embedded in
the data source declaration. Access uses the "=" sign to
indicate that a VBA function is called.

(~: Grin for Douglas who missed that :~)

(david)


bindurajeesh said:
I have created a function and am calling it from a query as an
expression.
When I run the query all is fine but when I run the report that uses the
query I am told that it can not find the macro PreadScreenTime([event_sysid])
which is the function that I am useing. Why is it looking for a macro when
it is clearly a function that is being used? The report asks for the
data of
the function by the name of the field in the query. The field is labled as:
PreAdScreen: PreAdScreenTime([event_sysid]). Thanks
 
Back
Top