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

Determine if Access Table is Empty (no Records)

Status
Not open for further replies.

dobber

Programmer
Aug 18, 2000
21
0
0
US
Help, Help

Does anyone know of a procedure for Access 2000 that
will look at a table, determine if it is empty (contains
no records), and then return a True/False?

I've tried everthing I can think of, and I'm stuck on this
code for the day.
 
Have you tried DCount?

r = IIf(dcount("*", "table")>0,True,False)

If r > 0 then True (table contains rows) else False (table is empty).

However, it is just as effective to test the result of DCount("*","table"). Result = 0 is the same as False while Result > 0 is same as True. Terry

;-) USER, n.: The word computer professionals use when they mean "idiot." -Dave Barry

SQL Article links:
 
Thanks Terry,

That's exactly what I needed. I'm fairly new at
Access and I wasn't even aware of dcount.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top