Visible = True

P

Paul

Help please A2002
I am trying to make a label visible based on whether or not a field is
populated.
The table is called products and the field is called notes.
Each product in the table has unique id and not all the note fields are
populated
I can only get the label to be visible for every product
The Fields are
ProductId
ProductName
Status
Weight
DateAdded
Notes

On the product form the notes may indicate for example packaging information
- the
indicator label is show that there are notes to access if needed

Many thanks in advance for any help

Paul
 
K

Ken Snell \(MVP\)

Questions:

-- Are you trying to do this on a form? or on a report?

-- What have you tried (macro or VBA code)? Post what you've tried.
 
P

Paul

Thanks for responding Ken

I am trying to do this on a form products_frm

The Note is a label Note_lbl with the Visibility property set to no

My attempts

1/ If DLookup("Notes Is Null", "Products ") Then
Me!Notes_lbl.Visible = True
End If

2/ If Me!Products.Notes =Null then Me!Notes_lbl.Visible = True
End If

I have also tried various combinations such as <0

As each product Id is different I think I need a way of referencing the
ProductId in the code otherwise the label would be visible all the time for
all the products if there was a note entry in any line

Any ideas ?

Many thanks

Paul
 
P

Paul

Ken

I think I've found an answer

Private Sub Form_Current()
If IsNull([Product.Notes]) Then
Me.Notes_Lab.Visible = False
Else
Me.Notes_Lab.Visible = True
End If
End Sub

It seems to work ok - I think I went down the wrong track

Thanks
 
K

Ken Snell \(MVP\)

Paul said:
Ken

I think I've found an answer

Private Sub Form_Current()
If IsNull([Product.Notes]) Then
Me.Notes_Lab.Visible = False
Else
Me.Notes_Lab.Visible = True
End If
End Sub

It seems to work ok - I think I went down the wrong track


Glad you found an answer. I was busy with a work assignment (away from my PC
for four days) and was not able to get back to this thread.
 

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