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.