Aug 25 2008, 10:15 AM
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.
Aug 25 2008, 10:35 AM
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*)
Aug 25 2008, 10:42 AM
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)*
Aug 25 2008, 10:47 AM
Never mind i just read the bottom of your previous post. Thanks and forgive my stupidity.
Aug 25 2008, 11:33 AM
>> Thanks and forgive my stupidity. <<
... Your welcome!! ...
By the way ... I did edit my post immediately after I posted the expression ... so you may have missed the explaination ...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here