Test to see a table has record

  • Thread starter Thread starter Song Su
  • Start date Start date
S

Song Su

I use qryCreateCompEn to create a table with field EN which is integer. I
want to see if the table has record or not. My IF statement generates error
message "Type mismatch". Where did I do wrong?

Thanks.

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryCreateCompEn"

If "SELECT Sum(CompEn.EN) AS ENOfSum FROM CompEn =0" Then
MsgBox "No record need to print.", vbInformation, conAppName
Else
DoCmd.OpenQuery "qryCreateCompEnHour"
DoCmd.OpenForm "frmMarkPrintComplete"
End If
DoCmd.SetWarnings True
 

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

Back
Top