Please could you tell me where I am going wrong
I want to open 1 of 2 forms depending if a certain text is present in a field of a table.
If text "Expired" is present in the 'Name' field of Table 'MAIN' then open form 'Expired' and if is not present open form 'Data_In'.
The following code in the 'On Open' Event Criteria of a Hidden form, and does not work, that is to say neither form opens:
Private Sub Form_Open(Cancel As Integer) If DCount("Name", "MAIN", "Expired") = 0 Then DoCmd.OpenForm "Data_In", acNormal Else DoCmd.OpenForm "Expired", acNormal End If End Sub
Very new to this so suggested code to use in above sub routine would be appreciated.
Thanks in advance