Code to show label if form blank.

  • Thread starter Thread starter George Avery
  • Start date Start date
G

George Avery

If anyone can help me with this I'd be grateful.

I have a form which opens from code which shows only those records for
the logged on user. It works just how I want it to except that I would
like to show a label normally set to hidden only if there are no
records. The label will just say "If the form is blank then you have
no outstanding calls."

I envisaged some code along the lines of a check in the form's On Open
event to look at the recordset count and if <1 then
labelx.visible=true but the syntax/construction has beaten me.

TIA - GA
 
If anyone can help me with this I'd be grateful.

I have a form which opens from code which shows only those records for
the logged on user. It works just how I want it to except that I would
like to show a label normally set to hidden only if there are no
records. The label will just say "If the form is blank then you have
no outstanding calls."

I envisaged some code along the lines of a check in the form's On Open
event to look at the recordset count and if <1 then
labelx.visible=true but the syntax/construction has beaten me.

TIA - GA

In the Form's Open event:
LabelName.Visible = Me.RecordsetClone.RecordCount =0
 
On Thu, 20 Jan 2005 21:54:21 GMT, fredg <[email protected]>
wrote:

Thanks for the response Fred, but it doesn't work. It doesn't cause
errors when it is run (like my efforts did) but the label remains
hidden. Obviously I renamed "LabelName" appropriately but I still just
get a blank form and no label??
 
Back
Top