Clear the text of a textbox on a continuous form if another textbox has no data (1 Viewer)

Sam Summers

Registered User.
Local time
Today, 18:41
Joined
Sep 17, 2001
Messages
939
So far i have tried using vba to do this and but that clears all the rows so then i have been trying to achieve this with conditional formatting but am not getting it right?

I have searched and searched and just can't find out how to do this?

Surely its quite simple really?

Many thanks in advance
 

Ranman256

Well-known member
Local time
Today, 13:41
Joined
Apr 9, 2015
Messages
4,339
clearing the textbox will erase all the data in all the records. Is that what you want? (as you described)
but the 1st line says you do NOT want to delete all records. Thats what a continuous form does.
 

Sam Summers

Registered User.
Local time
Today, 18:41
Joined
Sep 17, 2001
Messages
939
clearing the textbox will erase all the data in all the records. Is that what you want? (as you described)
but the 1st line says you do NOT want to delete all records. Thats what a continuous form does.
Is there not a way of doing it using conditional formatting that only affects the row it is in?
 

Ranman256

Well-known member
Local time
Today, 13:41
Joined
Apr 9, 2015
Messages
4,339
conditional formatting only colorizes.
if you want to remove data, you need vb:

in the ON CURRENT event:
if isNull(txtBox1) then txtBox2 = ""
 

Sam Summers

Registered User.
Local time
Today, 18:41
Joined
Sep 17, 2001
Messages
939
conditional formatting only colorizes.
if you want to remove data, you need vb:

in the ON CURRENT event:
if isNull(txtBox1) then txtBox2 = ""
Thanks for that. Nothing happened?
It seems a difficult issue? txtbox1 was Null but still the name appeared in txtbox2. Its because there are multiple subforms each displaying a date where the associated UserName is inserted in the row of dates even if one is blank.
Maybe i can hide the textbox if the date textbox (textbox1) isNull?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:41
Joined
Feb 19, 2002
Messages
43,213
if isNull(txtBox1) then txtBox2 = ""
Actually, the command would be:

if isNull(txtBox1) then txtBox2 =Null

"" = ZLS and is only a valid character for text fields. Date or numeric fields would raise an error.
 

Sam Summers

Registered User.
Local time
Today, 18:41
Joined
Sep 17, 2001
Messages
939
Actually, the command would be:

if isNull(txtBox1) then txtBox2 =Null

"" = ZLS and is only a valid character for text fields. Date or numeric fields would raise an error.
Thank you Pat
 

Users who are viewing this thread

Top Bottom