Blank Form

  • Thread starter jervin via AccessMonster.com
  • Start date
J

jervin via AccessMonster.com

Hi,
I want to get rid of the blank form everytime i open. I had a form link with
a query and i wanted to prompt me sayin "data not found" instead of showing a
blank form. i just dont know how to do that...thanks ....
 
G

Gijs Beukenoot

jervin via AccessMonster.com schreef :
Hi,
I want to get rid of the blank form everytime i open. I had a form link with
a query and i wanted to prompt me sayin "data not found" instead of showing a
blank form. i just dont know how to do that...thanks ....

You can check me.recordset.eof to see if there are records

Or run the query before opening the form and see if there are any
records, if not, give a message, else open the form
 
J

jervin via AccessMonster.com

Where can i find this "You can check me.recordset.eof to see if there are
records" ? or how can i set this..

Am sorry am a beginner....thanks for your quick reply..
 
G

Gijs Beukenoot

Het is zò dat jervin via AccessMonster.com formuleerde :
Where can i find this "You can check me.recordset.eof to see if there are
records" ? or how can i set this..

Am sorry am a beginner....thanks for your quick reply..

Open the form in design, go to the properties, click on the
3-dots-button after the open-event and insert the following code :

Private Sub Form_Open(Cancel As Integer)

'EOF = True or RecordCount = 0 means no records
if Me.RecordSet.RecordCount > 0 then
'Records available, don't do anything
else
MsgBox "No records"
Cancel=true
end if

end sub
 
J

jervin via AccessMonster.com

thank you very much....preciate it...

Gijs said:
Het is zò dat jervin via AccessMonster.com formuleerde :
Where can i find this "You can check me.recordset.eof to see if there are
records" ? or how can i set this..
[quoted text clipped - 11 lines]
Open the form in design, go to the properties, click on the
3-dots-button after the open-event and insert the following code :

Private Sub Form_Open(Cancel As Integer)

'EOF = True or RecordCount = 0 means no records
if Me.RecordSet.RecordCount > 0 then
'Records available, don't do anything
else
MsgBox "No records"
Cancel=true
end if

end sub
 
Top