UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Count number of Tables    
 
   
TheCaptain
post Aug 25 2008, 10:15 AM
Post #1

UtterAccess Veteran
Posts: 384
From: AZ



Hello UA Members,

Not sure if i'm in the right thread here but here it goes. How can i count the number of Tables in TableDefs that the table name starts with "tbl_"? I have a command button on my form and want to put this code in the OnClick event. Any suggestions? Thanks in advance.

TheCaptain
Go to the top of the page
 
+
datAdrenaline
post Aug 25 2008, 10:35 AM
Post #2

UtterAccess Editor
Posts: 15,970
From: Northern Virginia, USA



Try out this expression ... it should get you what you need ...

DCount("*","MSysObjects","Left([Name],3) = 'tbl' And [Type] In (1,4,6)")

....

MSysObjects is a system table that Access maintains ... the tabledefs are entered in MsysObjects and can be of 3 different types ... 1= Local table, 4 = ODBC Linked table, 6 = Access linked table (I *think*)
Go to the top of the page
 
+
TheCaptain
post Aug 25 2008, 10:42 AM
Post #3

UtterAccess Veteran
Posts: 384
From: AZ



Brent,

Works great. Thanks. I was using the Dcount but had some wrong syntax. Can you tell me what the following is for in the expression?

and [Type] In (1,4,6)*

Thanks again

TheCaptain
Go to the top of the page
 
+
TheCaptain
post Aug 25 2008, 10:47 AM
Post #4

UtterAccess Veteran
Posts: 384
From: AZ



Never mind i just read the bottom of your previous post. Thanks and forgive my stupidity.
Go to the top of the page
 
+
datAdrenaline
post Aug 25 2008, 11:33 AM
Post #5

UtterAccess Editor
Posts: 15,970
From: Northern Virginia, USA



>> Thanks and forgive my stupidity. <<

(IMG:http://www.utteraccess.com/forum/style_emoticons/default/laugh.gif) ... Your welcome!! ... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)

...

By the way ... I did edit my post immediately after I posted the expression ... so you may have missed the explaination ... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif) ....
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 12:32 PM