Doug,
I tried it with and without the question mark. I got compile errors
both
times. With the question mark, I got the message; External name not
defined.
Without question mark I got the message; Expected: =
I used [OT Hours End] as the xxx.
Thanks,
Dwayne
:
A compile error, or an execution error?
Did you include the question mark at the beginning? What did you put
for
xxx?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
message
Doug,
I get a compile error;
Expected: =
Thanks,
Dwayne
:
What happens if you go to the Immediate window (Ctrl-G), type
?Serialize("OPS Communicators","OT Hours End",xxx)
(replacing xxx with a legitimate value) and hit Enter?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
message
Doug,
Sorry, yes I made it a module in the module area. Yes I did
verify
my
spelling was consistant in both areas.
Dwayne
:
You didn't answer one of my earlier questions: are you talking
about a
"true" module (one that you get to through
the Modules tab), as opposed to a module associated with a form
or
report?
I assume you've checked to ensure that you haven't mistyped the
name
of
the
function in your query.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
in
message
Doug,
Since I am still setting up the database, I am running it
after
I
save
by
going from design view to datasheet view. Also I get the
error
when
double
clicking on it.
Thanks,
Dwayne
:
How are you calling the query? Is it through code, or are you
simply
double-clicking on the query to open it? If you're opening it
through
code,
what's that code.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
"Dwayne Struble" <
[email protected]>
wrote
in
message
Here is the module I am trying to use.
Function Serialize(qryname As String, keyname As String,
keyvalue)
As
Long
Dim rs As Recordset
On Error GoTo Err_Serialize
Set rs = CurrentDb.OpenRecordset(qryname, dbOpenDynaset,
dbReadOnly)
rs.FindFirst Application.BuildCriteria(keyname,
rs.Fields(keyname).Type,
keyvalue)
Serialize = Nz(rs.AbsolutePosition, -1) + 1
Err_Serialize:
rs.Close
Set rs = Nothing
End Function
Here is how I am trying to call it in a query.
Expr1: Serialize("OPS Communicators","OT Hours End",[OT
Hours
End])
Thanks,
Dwayne
:
Functions called from queries need to be public functions
saved
to
a
module.
Could you post your code and the SQL from your query?
Barry
:
I am a new Access user, and am using access 97. I am
working
on
setting up a
callout list where the order is determined by overtime
hours
worked.
I
set
upa query that adds the hours at start of pay period
with
the
hours
worked
and gets total then sorts it. I then need it to show
the
updated
place
in
the order. I found a funtion that does that in another
post
here,
but
when I
put the funtion in a module and called it in the query,
I
get
an
error
stating undefined funtion. Thanks for your help.