empty table

  • Thread starter Thread starter Rover
  • Start date Start date
R

Rover

I have a form where I run a query that creates a table. I want to
display that table on the condition that it is not empty. How do I do that?

TIA

Jim
 
Try This: -
Function OpenUserTable()
Dim dbs As Database, rst as RecordSet,TempNo as Integer
Set dbs=currentdb:set rst as dbs.openrecordset("ENTER
TABLE NAME HERE",dbopendynaset)
On Error Goto continueopen
rst.movelast
TempNo=rst.RecordCount
ContinueOpen:
set rst=nothing:set dbs=nothing
if tempno=0 then exit function
Docmd.OpenTable ("ENTER TABLE NAME HERE"),SET OPTIONS HERE
End Function

You need to add "Microsoft DAO 3.6 Object Libray" to the
references in order for this to work.

The bits in CAPS are for you to enter the required table
name and to set the options when opening the Table (read
only etc).

HTH

Tony C.
 
Back
Top