Report textboxes - visible vs not visible

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

2 of the columns in my report have textboxes, say txtA and txtB, of exactly
the same size. txtA contains numbers while txtB is either a string or "". I
was thinking of positioning txtB directly on top of txtA. Here's what I'm
after - If txtB has a value, I want it to show. Otherwise I want txtA to
show.

For some reason I'm having trouble with this. Could someone point the way?

thank you
 
Sarah said:
2 of the columns in my report have textboxes, say txtA and txtB, of
exactly the same size. txtA contains numbers while txtB is either a
string or "". I was thinking of positioning txtB directly on top of
txtA. Here's what I'm after - If txtB has a value, I want it to
show. Otherwise I want txtA to show.

For some reason I'm having trouble with this. Could someone point
the way?

thank you

One TextBox with expression...

=IIf(Len(txtB & "") = 0, txtA, txtB)
 
2 of the columns in my report have textboxes, say txtA and txtB, of exactly
the same size. txtA contains numbers while txtB is either a string or "". I
was thinking of positioning txtB directly on top of txtA. Here's what I'm
after - If txtB has a value, I want it to show. Otherwise I want txtA to
show.

For some reason I'm having trouble with this. Could someone point the way?

thank you

you could code the Report section's Format event:
If IsNull(TextB) then
TextB.Visible = False
TextA.Visible = True
Else
TextB.Visible = True
TextA.Visible = False
End If

But why not simply use an unbound text control.

=IIf(IsNull([TextB]),[TextA],[TextB])

No other coding required.
 
yes, of course. Thanks to and Rick and fredg.

fredg said:
2 of the columns in my report have textboxes, say txtA and txtB, of exactly
the same size. txtA contains numbers while txtB is either a string or "". I
was thinking of positioning txtB directly on top of txtA. Here's what I'm
after - If txtB has a value, I want it to show. Otherwise I want txtA to
show.

For some reason I'm having trouble with this. Could someone point the way?

thank you

you could code the Report section's Format event:
If IsNull(TextB) then
TextB.Visible = False
TextA.Visible = True
Else
TextB.Visible = True
TextA.Visible = False
End If

But why not simply use an unbound text control.

=IIf(IsNull([TextB]),[TextA],[TextB])

No other coding required.
 

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

Back
Top