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.
 
Back
Top