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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detecting if a form has records

Status
Not open for further replies.

Kalin

Programmer
Jul 24, 2001
76
NL
Does anybody have a clue as how to detect if a form in non-entry mode (AllowAdditions = False) has any records upon opening.

Grtz,

Kalin
 
hi,

after setting the recordsource in the form_open procedure you can:

dim rcs_a as recordset
set rcs_a = me.recordsetclone
if rcs_a.recordcount = 0 then
' do your thing
msgbox "no records"
rcs_a.close
set rcs_a = nothing
docmd.cancelevent
exit sub
end if


grtz

CPU-burn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top