# Error in Unbound text box.

G

gr

Hi, I am trying to append a string to an unbound txtbox.
the unbound txtbox is named txtReg1 and it's control
source is set to:
=IIf([RegisterNumber]=1;IIf(IsNull([txtReg1]);[DocName];
[txtReg1] & Chr(10) & Chr(13) & [DocName]);" ")

So, if the txtReg1 is null, just put the current DocName
for RegisterNumber 1, but if it's not null (there was a
previous match for Register Number 1), then keep txtReg1
old value append return carriage and the new match.

But the only thing i get is #Error, what's wrong?
 
J

Jeff Boyce

Have you tried breaking this into smaller pieces/steps, and confirming each
piece? Have you tried doing this in a query to see what it generates?
 
W

Wayne Morgan

It appears you are using semicolons (;) as section dividers, it should be
commas (,).
 
J

Jeff Boyce

Oooh! Nice catch!

Jeff

Wayne Morgan said:
It appears you are using semicolons (;) as section dividers, it should be
commas (,).

--
Wayne Morgan
Microsoft Access MVP


gr said:
Hi, I am trying to append a string to an unbound txtbox.
the unbound txtbox is named txtReg1 and it's control
source is set to:
=IIf([RegisterNumber]=1;IIf(IsNull([txtReg1]);[DocName];
[txtReg1] & Chr(10) & Chr(13) & [DocName]);" ")

So, if the txtReg1 is null, just put the current DocName
for RegisterNumber 1, but if it's not null (there was a
previous match for Register Number 1), then keep txtReg1
old value append return carriage and the new match.

But the only thing i get is #Error, what's wrong?
 
M

Marshall Barton

I'm not sure, but isn't the semicolon used in locales that
use comma as the decimal point.

I believe the problem is that the expression in text box
txtReg1 refers to itself. This kind of calculation should
be done in an event procedure to avoid a circular reference.
--
Marsh
MVP [MS Access]



Jeff said:
Oooh! Nice catch!

Wayne Morgan said:
It appears you are using semicolons (;) as section dividers, it should be
commas (,).

gr said:
Hi, I am trying to append a string to an unbound txtbox.
the unbound txtbox is named txtReg1 and it's control
source is set to:
=IIf([RegisterNumber]=1;IIf(IsNull([txtReg1]);[DocName];
[txtReg1] & Chr(10) & Chr(13) & [DocName]);" ")

So, if the txtReg1 is null, just put the current DocName
for RegisterNumber 1, but if it's not null (there was a
previous match for Register Number 1), then keep txtReg1
old value append return carriage and the new match.

But the only thing i get is #Error, what's wrong?
 
G

Guest

yes, the semicolons were not the problem. I code a nested
if in the details on format event and worked perfect =)
thanks all
-----Original Message-----
I'm not sure, but isn't the semicolon used in locales that
use comma as the decimal point.

I believe the problem is that the expression in text box
txtReg1 refers to itself. This kind of calculation should
be done in an event procedure to avoid a circular reference.
--
Marsh
MVP [MS Access]



Jeff said:
Oooh! Nice catch!

"Wayne Morgan"
It appears you are using semicolons (;) as section dividers, it should be
commas (,).

Hi, I am trying to append a string to an unbound txtbox.
the unbound txtbox is named txtReg1 and it's control
source is set to:
=IIf([RegisterNumber]=1;IIf(IsNull([txtReg1]); [DocName];
[txtReg1] & Chr(10) & Chr(13) & [DocName]);" ")

So, if the txtReg1 is null, just put the current DocName
for RegisterNumber 1, but if it's not null (there was a
previous match for Register Number 1), then keep txtReg1
old value append return carriage and the new match.

But the only thing i get is #Error, what's wrong?
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top