T
Tatakau
I have several rather complicated queries that are used for mail merges that
use functions as their fields.
ex: Field~ Tour Time: IIF(Format([time],"h:mm AM/PM")="12:00
PM","12:00 Noon",Format([time],"h:mm AM/PM"))
However, if by chance the value of [time] is null for a given record, it
will cause an error in the code (internal - nothing visible;
format(null,"h:mm AM/PM") doesn't go over very well), and because of this, it
will not show up in the query results. I could fix this by doing the
following:
ex: Field~ Tour Time: IIF(isnull([time]),"",IIF(Format([time],"h:mm
AM/PM")="12:00 PM","12:00 Noon",Format([time],"h:mm AM/PM")))
but then I would have to go over every single one of my queries and
painstakingly edit every individual query field that uses a function. Which
would just be a pain in the ass.
So, I was wondering if someone could sorta do it for me. $5 per hour. lol,
not really, but it'd be nice if I could make the Jet engine just ignore
errors alltogether in a query. If it can't exceute a function because of a
null value in a table, why omit the entire record? I'd like to do something
like "On Error Resume Next", but this isn't exactly VBA. Is there something
similar I could do?
Thanks!
Nick
use functions as their fields.
ex: Field~ Tour Time: IIF(Format([time],"h:mm AM/PM")="12:00
PM","12:00 Noon",Format([time],"h:mm AM/PM"))
However, if by chance the value of [time] is null for a given record, it
will cause an error in the code (internal - nothing visible;
format(null,"h:mm AM/PM") doesn't go over very well), and because of this, it
will not show up in the query results. I could fix this by doing the
following:
ex: Field~ Tour Time: IIF(isnull([time]),"",IIF(Format([time],"h:mm
AM/PM")="12:00 PM","12:00 Noon",Format([time],"h:mm AM/PM")))
but then I would have to go over every single one of my queries and
painstakingly edit every individual query field that uses a function. Which
would just be a pain in the ass.
So, I was wondering if someone could sorta do it for me. $5 per hour. lol,
not really, but it'd be nice if I could make the Jet engine just ignore
errors alltogether in a query. If it can't exceute a function because of a
null value in a table, why omit the entire record? I'd like to do something
like "On Error Resume Next", but this isn't exactly VBA. Is there something
similar I could do?
Thanks!
Nick