Opening different forms based on count of similar items

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to open up one form if the count of a table record field is 1, and a
different form if the count is more than one. What would the coding be for
that?
 
Hendricks97 said:
I want to open up one form if the count of a table record field is 1, and a
different form if the count is more than one. What would the coding be for
that?

You didn't specify what should happen if no records are found, so I
didn't address that.

If DCount("[FieldName]","TableName") =1 Then
DoCmd.OpenForm "FormName1"
Else
DoCmd.OpenForm "FormName2orMore"
End If

HTH,
Chris M.
 

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