Report Visible Question!

B

Bob V

If the text box on my Report [tbCashSale] (text) has a word in it I want
tbAccountName to be Invisible but if [tbCashSale] has no word in it I want
it to be visible
Thanks For any Help............Bob
tbAccountName.Visible = Len([tbCashSale] & vbNullString) < 0
 
A

Allen Browne

Try a text box with Control Source like this:
=IIf([tbCashSale] Is Null, [tbAccountName], Null)

Note that the Name property of this text box must be the same as a field
name (e.g. it cannot be tbCashSale or tbAccountName.)
 
B

Bob V

Thanks Allen , I am getting a compile error
Expected line number or label.......................
I entered the code here:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ProcError
Thanks for the help...Bob

Allen Browne said:
Try a text box with Control Source like this:
=IIf([tbCashSale] Is Null, [tbAccountName], Null)

Note that the Name property of this text box must be the same as a field
name (e.g. it cannot be tbCashSale or tbAccountName.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Bob V said:
If the text box on my Report [tbCashSale] (text) has a word in it I want
tbAccountName to be Invisible but if [tbCashSale] has no word in it I
want it to be visible
Thanks For any Help............Bob
tbAccountName.Visible = Len([tbCashSale] & vbNullString) < 0
 
A

Allen Browne

Compile error? Did you put this in the code window?

It's intended to go the Control Source of a text box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Bob V said:
Thanks Allen , I am getting a compile error
Expected line number or label.......................
I entered the code here:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ProcError
Thanks for the help...Bob

Allen Browne said:
Try a text box with Control Source like this:
=IIf([tbCashSale] Is Null, [tbAccountName], Null)

Note that the Name property of this text box must be the same as a field
name (e.g. it cannot be tbCashSale or tbAccountName.)

Bob V said:
If the text box on my Report [tbCashSale] (text) has a word in it I
want tbAccountName to be Invisible but if [tbCashSale] has no word in it
I want it to be visible
Thanks For any Help............Bob
tbAccountName.Visible = Len([tbCashSale] & vbNullString) < 0
 
B

Bob V

Thanks Allen, but I all ready have this in my control Source
=IIf(IsNull([tbDirectBank]),"",DLookUp("DirectName","tblCompanyInfo"))
And how would I go about labels?
Would something like this work in the code window
tbAccountName.Visible = (Nz(Me![tbCashSale], "Cash Sale") = " ")
The last bit being Blank = " ")

Tahnks..............Bob

Allen Browne said:
Compile error? Did you put this in the code window?

It's intended to go the Control Source of a text box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Bob V said:
Thanks Allen , I am getting a compile error
Expected line number or label.......................
I entered the code here:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ProcError
Thanks for the help...Bob

Allen Browne said:
Try a text box with Control Source like this:
=IIf([tbCashSale] Is Null, [tbAccountName], Null)

Note that the Name property of this text box must be the same as a field
name (e.g. it cannot be tbCashSale or tbAccountName.)



If the text box on my Report [tbCashSale] (text) has a word in it I
want tbAccountName to be Invisible but if [tbCashSale] has no word in
it I want it to be visible
Thanks For any Help............Bob
tbAccountName.Visible = Len([tbCashSale] & vbNullString) < 0
 
B

Bob V

Allen, this is working but just have to find away to Requery so as when you
change from [Cash sale] to [ ] it changes on the next report???
Thanks............Bob

Bob V said:
Thanks Allen, but I all ready have this in my control Source
=IIf(IsNull([tbDirectBank]),"",DLookUp("DirectName","tblCompanyInfo"))
And how would I go about labels?
Would something like this work in the code window
tbAccountName.Visible = (Nz(Me![tbCashSale], "Cash Sale") = " ")
The last bit being Blank = " ")

Tahnks..............Bob

Allen Browne said:
Compile error? Did you put this in the code window?

It's intended to go the Control Source of a text box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Bob V said:
Thanks Allen , I am getting a compile error
Expected line number or label.......................
I entered the code here:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ProcError
Thanks for the help...Bob

Try a text box with Control Source like this:
=IIf([tbCashSale] Is Null, [tbAccountName], Null)

Note that the Name property of this text box must be the same as a
field name (e.g. it cannot be tbCashSale or tbAccountName.)



If the text box on my Report [tbCashSale] (text) has a word in it I
want tbAccountName to be Invisible but if [tbCashSale] has no word in
it I want it to be visible
Thanks For any Help............Bob
tbAccountName.Visible = Len([tbCashSale] & vbNullString) < 0
 
A

Allen Browne

Didn't follow that, Bob.

I don't know if you are changing reports, tables, controls, code, ...

You can probably modify the example you already have working.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Bob V said:
Allen, this is working but just have to find away to Requery so as when
you change from [Cash sale] to [ ] it changes on the next report???
Thanks............Bob

Bob V said:
Thanks Allen, but I all ready have this in my control Source
=IIf(IsNull([tbDirectBank]),"",DLookUp("DirectName","tblCompanyInfo"))
And how would I go about labels?
Would something like this work in the code window
tbAccountName.Visible = (Nz(Me![tbCashSale], "Cash Sale") = " ")
The last bit being Blank = " ")

Tahnks..............Bob

Allen Browne said:
Compile error? Did you put this in the code window?

It's intended to go the Control Source of a text box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Thanks Allen , I am getting a compile error
Expected line number or label.......................
I entered the code here:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ProcError
Thanks for the help...Bob

Try a text box with Control Source like this:
=IIf([tbCashSale] Is Null, [tbAccountName], Null)

Note that the Name property of this text box must be the same as a
field name (e.g. it cannot be tbCashSale or tbAccountName.)



If the text box on my Report [tbCashSale] (text) has a word in it I
want tbAccountName to be Invisible but if [tbCashSale] has no word in
it I want it to be visible
Thanks For any Help............Bob
tbAccountName.Visible = Len([tbCashSale] & vbNullString) < 0
 
Top