Display error in distribution file but not development file?!?!?

  • Thread starter Thread starter Chris O''Neill
  • Start date Start date
C

Chris O''Neill

I'm having a weird problem I'm hoping someone can explain...

In my development MDB file, I have a text box on a form that has this in the
ControlSource field:

="Persons Related To: "+Trim$([txtFirstName])+" "+Trim$([txtLastName])

When I run the application in my development MDB file, it displays properly:

"Persons Related To: Chris O'Neill"

However, when I compile the MDB into an MDE file and distribute it to the
users, I get the dreaded "#Name?" error. I know that I can probably (?) fix
this using the Nz() function, but I'm curious why it would work on my
computer and not on someone else's???

Thanks, in advance, for any advice and assistance provided.

Regards, Chris
 
Most common reason would be a problem with the References collection.

Unfortunately, since MDEs don't contain actual VBA code, it's a bit of a
pain to track them down and correct with MDEs.

I talk a bit about it inhttp://www.accessmvp.com/djsteele/AccessReferenceErrors.htmlas well as in
my December, 2003 "Access Answers" column in Pinnacle Publication's "Smart
Access". You can download the column (and sample database) for free athttp://www.accessmvp.com/djsteele/SmartAccess.html

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)




I'm having a weird problem I'm hoping someone can explain...
In my development MDB file, I have a text box on a form that has this in
the
ControlSource field:
   ="Persons Related To:  "+Trim$([txtFirstName])+" "+Trim$([txtLastName])
When I run the application in my development MDB file, it displays
properly:
  "Persons Related To:  Chris O'Neill"
However, when I compile the MDB into an MDE file and distribute it to the
users, I get the dreaded "#Name?" error.  I know that I can probably (?)
fix
this using the Nz() function, but I'm curious why it would work on my
computer and not on someone else's???
Thanks, in advance, for any advice and assistance provided.
Regards,  Chris- Hide quoted text -

- Show quoted text -

Ah, although I am no expert, and I have never tried the "txtField1 +
txtField2" method of putting things together, but shouldn't you be
using ="Persons Related To: " & Trim$([txtFirstName]) & " " & Trim$
([txtLastName]) ?

I have never had a problem when doing things that way.
 
I'm having a weird problem I'm hoping someone can explain...

In my development MDB file, I have a text box on a form that has this in the
ControlSource field:

    ="Persons Related To:  "+Trim$([txtFirstName])+" "+Trim$([txtLastName])

When I run the application in my development MDB file, it displays properly:

   "Persons Related To:  Chris O'Neill"

However, when I compile the MDB into an MDE file and distribute it to the
users, I get the dreaded "#Name?" error.  I know that I can probably (?) fix
this using the Nz() function, but I'm curious why it would work on my
computer and not on someone else's???

Thanks, in advance, for any advice and assistance provided.

Regards,  Chris

Ah, although I am no expert, and I have never tried the "txtField1 +
txtField2" method of putting things together, but shouldn't you be
using ="Persons Related To: " & Trim$([txtFirstName]) & " " & Trim$
([txtLastName]) ?
 
Douglas J. Steele said:
Most common reason would be a problem with the References collection.

Well DRAT!!! :(
Unfortunately, since MDEs don't contain actual VBA code, it's a bit of a
pain to track them down and correct with MDEs.

DRAT!!! DRAT!!! DRAT!!! :((
I talk a bit about it in
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html as well as in
my December, 2003 "Access Answers" column in Pinnacle Publication's "Smart
Access". You can download the column (and sample database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html

(SIGH!) Thanks for that info, Doug. I did take a look at both articles.
Just FYI, the machine that's having the problem is running the same version
of Access (2002/XP) as the development machine. The development machine is
on Vista and theh problem machine is on XP. Btw, I'm not using any esoteric
libraries (just the ones that come "default" with Access XP plus DAO 3.6).

I tried taking out the Trim$ function but, alas, that didn't work. I
manaully added the reference to DAO 3.6 was added to the problem machine.
Neither fixed the problem. Since I'm dealing with an MDE file, using the
reference-fixer utilities mentioned in your article won't work, right?

Any other thoughts or suggestions?

Thanks for your help, even though you've wrecked my day! :D

Regards, Chris
 
DawnTreader said:
Ah, although I am no expert, and I have never tried the "txtField1 +
txtField2" method of putting things together, but shouldn't you be
using ="Persons Related To: " & Trim$([txtFirstName]) & " " & Trim$
([txtLastName]) ?

Well I'll be danged! I didn't notice that I used the arithmatic "+" instead
of the concantation "&" to put that together! I always use "&" so I'm not
sure where my mind was when I used the plus sign.

I'll give that a try and see if it fixes it. Thanks!

Regards, Chris
 
While it is preferable to use & for concatenation, + is also permissible.
There is a subtle difference between the two: + propagates Nulls, while &
doesn't. In other words, "something" + Null results in Null, while
"something" & Null results in "something". However, I doubt very much that
that's relevant for this problem.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DawnTreader said:
- Show quoted text -

Ah, although I am no expert, and I have never tried the "txtField1 +
txtField2" method of putting things together, but shouldn't you be
using ="Persons Related To: " & Trim$([txtFirstName]) & " " & Trim$
([txtLastName]) ?

I have never had a problem when doing things that way.
 
Chris O''Neill said:
(SIGH!) Thanks for that info, Doug. I did take a look at both articles.
Just FYI, the machine that's having the problem is running the same
version
of Access (2002/XP) as the development machine. The development machine
is
on Vista and theh problem machine is on XP. Btw, I'm not using any
esoteric
libraries (just the ones that come "default" with Access XP plus DAO 3.6).

Which libraries you are (or aren't) using isn't really relevant. It's quite
conceivable that, since you're talking about two different operating
systems, you've got different versions of files at play.
I tried taking out the Trim$ function but, alas, that didn't work. I
manaully added the reference to DAO 3.6 was added to the problem machine.
Neither fixed the problem. Since I'm dealing with an MDE file, using the
reference-fixer utilities mentioned in your article won't work, right?

Correct. None of the utilities mentioned will work. However, read the
section on that page after where I list the various utilities. I
specifically describe a technique that should work on MDEs.
 
While it is preferable to use & for concatenation, + is also
permissible. There is a subtle difference between the two: +
propagates Nulls, while & doesn't. In other words, "something" +
Null results in Null, while "something" & Null results in
"something".

I don't consider that a subtle difference at all! It's a *crucial*
difference, and one that is incredibly useful, say for instance:

Mid(("12" + LastName) & (", " + FirstName), 3)
 
Douglas J. Steele said:
While it is preferable to use & for concatenation, + is also permissible.
There is a subtle difference between the two: + propagates Nulls, while &
doesn't. In other words, "something" + Null results in Null, while
"something" & Null results in "something". However, I doubt very much that
that's relevant for this problem.

Actually, it did make a difference. I'm not sure why it worked on the
development machine but not another machine, but when I changed "+" to "&"
everything worked fine on the other machine. Go figure!

Anyway, like I said, I never use "+" for non-arithmatic stuff, so my mind
must've been on another planet when I did it in this case. A global search
of the entire application didn't find any other instances of "+" instead of
"&".

My punishment, for such a dumb error, is to program everything in Cobol for
the next week! (Oh, no!!!) :D

Thanks, Dawn (and everyone!), for the help!

Regards, Chris
 
Hello All

I was pleased to be of assistance. :)

Chris O''Neill said:
Actually, it did make a difference. I'm not sure why it worked on the
development machine but not another machine, but when I changed "+" to "&"
everything worked fine on the other machine. Go figure!

Anyway, like I said, I never use "+" for non-arithmatic stuff, so my mind
must've been on another planet when I did it in this case. A global search
of the entire application didn't find any other instances of "+" instead of
"&".

My punishment, for such a dumb error, is to program everything in Cobol for
the next week! (Oh, no!!!) :D

Thanks, Dawn (and everyone!), for the help!

Regards, Chris
 
Back
Top