Kate,
No worries, I'm not expecting you to be an expert. :-) Just wondering
whether you could change it, that's all.
The amount of time a line of code such as we discussed
CurrentDb.Execute... would take to run on your computer would be
measured in microseconds - it would be so quick you couldn't detect it.
So there must be something else causing this 30 second whatever it is.
"[SpouseName]=Null" does not compute. The syntax should be:
IIf([SpouseName] Is Null, ...
or:
IIf(IsNull([SposeName]), ...
Using the existence of data in SpouseName as the test would be more
reliable, and therefore the value of the Married and Single fields
becomes irrelevant, right?
Another way to write in might be like this:
Name1: [FirstName] & IIf(IsNull([SpouseName]),""," & " & [SpouseName])
Here's how I would do it myself, neater but perhaps less inuitive:
Name1: [FirstName] & " & "+[SpouseName]
By the way, as an aside, 'name' is a Reserved Word (i.e. has a special
meaning) in Access, and as such should not be used as the name of a
field or control.
--
Steve Schapel, Microsoft Access MVP
Kate wrote:
> I am running it on a P4 2.4 with 1 gig Memory. There are less than 200
> records in it. I have realized now I should have used a group with option
> buttons, but I am querying the married checkbox for a mail merge. Here is my
> query: Married is the checkbox. What I want is to put an & sign between
> firstname & spoure if married.
> This works:
> Name: IIf([Married]=-1,[FirstName] & " & " & [SpouseName],[FirstName])
>
> I tried this it doesn't work.
> Name1: IIf([SpouseName]=Null,[FirstName],[FirstName] & " & " & [SpouseName])
> This puts an & sign after the single and married person.
>
> Like I said before I don't know alot about seting up a database correctly.
> I am just trying to help out the church.
>
> Thanks again for your replys.
|