Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form empty recordset, display msgbox

Status
Not open for further replies.
May 5, 2000
168
US
I would like to display a msgbox when a forms recordset is empty.

In report properties there is an option for "on no data", but there doesn't seem to be anything like that for a form. Anyone know the answer?
 
This is an option I used. Iset my Forms Caption Property To No Record To Display. that way it is always is defaulteld to that. then when the form is open and on the OnCurrent_Event I test for a field I know Is going to be there if there is a record.

If(IsNull(Me.ID)) Then
Me.Caption = "Here is the Data"
Else
Me.Caption = "There is no Data"
End If

i know this does not show in big letters on the form but if you want to do that then create a label and type in it No Data To Display. Set it's visible property to False then run the same test.

If(IsNull(Me.ID)) Then
Me.Label.Visible = True
Else
Me.Label.Visible = False
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top