Show label

  • Thread starter Thread starter nerb61 via AccessMonster.com
  • Start date Start date
N

nerb61 via AccessMonster.com

I want to show a label only if certain fields in a table are all not null

The user can fill in any one of 7 fields on multiple subforms all populating
one table - if any one of them is filled in, I want a label to appear on the
main form. Otherwise, I want the label hidden.

Thanks in advance.
 
In the form's Current event, set the label's Visible property to False.

In each of the 7 text boxes' Update event, simply set the label's Visible
property to True if the text box's value is not null (you may have to play
around with this; it may equal " " (1 blank), or "" (empty string) instead of
null, especially if you put a value into the text box and, after updating -
read: went to another control -, went back and removed it).

Hope this helps,

Sam
 
You can use Nz to cover null and empty string in one shot:
if Nz(Me.textbox1,"") = "" Then
Me.label.visible
End if
 
oops me.label.visible = TRUE

Sorry about that!

SusanV said:
You can use Nz to cover null and empty string in one shot:
if Nz(Me.textbox1,"") = "" Then
Me.label.visible
End if
 
Susan,

I think you mean

if Nz(Me.textbox1,"") > "" Then Me.label.visible = True

Sam
You can use Nz to cover null and empty string in one shot:
if Nz(Me.textbox1,"") = "" Then
Me.label.visible
End if
In the form's Current event, set the label's Visible property to False.
[quoted text clipped - 19 lines]
 
Yep saw that as I hit send.

;-)


OfficeDev18 via AccessMonster.com said:
Susan,

I think you mean

if Nz(Me.textbox1,"") > "" Then Me.label.visible = True

Sam
You can use Nz to cover null and empty string in one shot:
if Nz(Me.textbox1,"") = "" Then
Me.label.visible
End if
In the form's Current event, set the label's Visible property to False.
[quoted text clipped - 19 lines]
Thanks in advance.
 
or even

label.visible = Not ISNULL(mytextbox)

but this all assumes the op is talking about producing a lable 'at the time'
a box is completed - where he could well mean if any of the boxes are
already completed - in which case a loop of the textboxes is ness in form
current


SusanV said:
Yep saw that as I hit send.

;-)


OfficeDev18 via AccessMonster.com said:
Susan,

I think you mean

if Nz(Me.textbox1,"") > "" Then Me.label.visible = True

Sam
You can use Nz to cover null and empty string in one shot:
if Nz(Me.textbox1,"") = "" Then
Me.label.visible
End if

In the form's Current event, set the label's Visible property to False.

[quoted text clipped - 19 lines]

Thanks in advance.
 
Great thanks for the help - now I have another label issue.

Same application: There are multiple questions (subform frmQuestions) on
individuals Issues (frmIssues). Once all the questions within an Issue have
been answered, I'd like another Label to appear to show the entire Issue is
COMPLETE.

Any ideas..

Susan,

I think you mean

if Nz(Me.textbox1,"") > "" Then Me.label.visible = True

Sam
You can use Nz to cover null and empty string in one shot:
if Nz(Me.textbox1,"") = "" Then
[quoted text clipped - 6 lines]
 
I have a similar form, below is the code I use to check whether a report has
been started but now yet completed.
On the main form's On current event:

Dim s, c

s = Nz(Me.subfrmTimeLine.Form!Start, "")
c = Nz(Me.subfrmTimeLine.Form!LSGComplete, "")
If s <> "" And _
c = "" Then
Me.lblInProgress.Visible = True
Else
Me.lblInProgress.Visible = False
End If

Modify the above to properly reflect your form and control names, and keep
in mind that I'm only checking 2 controls on the subform, so you'll have to
add additional code to cover how ever many controls you need to check.

--
hth,
SusanV




nerb61 via AccessMonster.com said:
Great thanks for the help - now I have another label issue.

Same application: There are multiple questions (subform frmQuestions) on
individuals Issues (frmIssues). Once all the questions within an Issue
have
been answered, I'd like another Label to appear to show the entire Issue
is
COMPLETE.

Any ideas..

Susan,

I think you mean

if Nz(Me.textbox1,"") > "" Then Me.label.visible = True

Sam
You can use Nz to cover null and empty string in one shot:
if Nz(Me.textbox1,"") = "" Then
[quoted text clipped - 6 lines]
Thanks in advance.
 
My problem is that the subform doesn't have a static start and end. There are
various number of questions (subform) within each issue (main form). Is there
a way to use your code with a BOF and EOF?

Dim s, c

s = Nz(Me.frmQuestions.Form!QuestionName.BOF, "")
c = Nz(Me.frmQuestions.Form!QuestionName.EOF, "")
If s <> "" And _
c = "" Then
Me.lblDecisionComplete.Visible = True
Else
Me.lblDecisionComplete.Visible = False
End If
I have a similar form, below is the code I use to check whether a report has
been started but now yet completed.
On the main form's On current event:

Dim s, c

s = Nz(Me.subfrmTimeLine.Form!Start, "")
c = Nz(Me.subfrmTimeLine.Form!LSGComplete, "")
If s <> "" And _
c = "" Then
Me.lblInProgress.Visible = True
Else
Me.lblInProgress.Visible = False
End If

Modify the above to properly reflect your form and control names, and keep
in mind that I'm only checking 2 controls on the subform, so you'll have to
add additional code to cover how ever many controls you need to check.
Great thanks for the help - now I have another label issue.
[quoted text clipped - 20 lines]
 
I'm a bit unsure of your structure - are you saying this subform has a
varying number of controls, depending on what the issue is? Or a varying
number of records?


nerb61 via AccessMonster.com said:
My problem is that the subform doesn't have a static start and end. There
are
various number of questions (subform) within each issue (main form). Is
there
a way to use your code with a BOF and EOF?

Dim s, c

s = Nz(Me.frmQuestions.Form!QuestionName.BOF, "")
c = Nz(Me.frmQuestions.Form!QuestionName.EOF, "")
If s <> "" And _
c = "" Then
Me.lblDecisionComplete.Visible = True
Else
Me.lblDecisionComplete.Visible = False
End If
I have a similar form, below is the code I use to check whether a report
has
been started but now yet completed.
On the main form's On current event:

Dim s, c

s = Nz(Me.subfrmTimeLine.Form!Start, "")
c = Nz(Me.subfrmTimeLine.Form!LSGComplete, "")
If s <> "" And _
c = "" Then
Me.lblInProgress.Visible = True
Else
Me.lblInProgress.Visible = False
End If

Modify the above to properly reflect your form and control names, and keep
in mind that I'm only checking 2 controls on the subform, so you'll have
to
add additional code to cover how ever many controls you need to check.
Great thanks for the help - now I have another label issue.
[quoted text clipped - 20 lines]
Thanks in advance.
 
Varying number of records.


I'm a bit unsure of your structure - are you saying this subform has a
varying number of controls, depending on what the issue is? Or a varying
number of records?
My problem is that the subform doesn't have a static start and end. There
are
[quoted text clipped - 39 lines]
 
I can't seem to get my mind around a method of displaying such a label. I
need to be able to display the "Completed" label once the user has answered
all the questions within each issue. The questions are on the subform and are
labeled once they are complete - there are varying number of questions within
each issue. I only want the "Completed" label to appear if all the questions
within the issue have been answered (have the question completed label
visible). I can't think of a way to make this happen. Perhaps a new field in
the table showing complete? A not null value? I'm just not sure.

Any help greatly appreciated.
 
Back
Top