Checking if a table has records in it

B

Bill Nark

I am trying to check if a table has records in it. If it does not I want to
run an append query if it does I want to go to the next command line. I tried
opening the table and using an isempty command on the first field in the
condition line but it gives me an error saying it doesn't recognize the table
name. Does anyone have any ideas?
 
S

stumac

is this in a macro? If so you could use the Dcount function in the condition
column.
e.g:
DCount("*","yourtable")>0 (this will perform the action as long as you have
any records)

If it is in vb you could use it within an if statement.

hth

Stu
 
B

Bill Nark

Worked like a charm, thanks!

stumac said:
is this in a macro? If so you could use the Dcount function in the condition
column.
e.g:
DCount("*","yourtable")>0 (this will perform the action as long as you have
any records)

If it is in vb you could use it within an if statement.

hth

Stu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top