the message box only displays if the first record in the subfrom "00upc created" contains the value 3. i would like the code to check all records in subform.
Private Sub Command220_Click()
On Error GoTo Err_Command220_Click
If Me.Form("00 upc creatED").Controls("group 2").Value = 3 Then
MsgBox ("Already created! Try Again.")
Else
DoCmd.OpenForm "00 upc create", , , ""
Forms("00 upc create").Controls("dvd release").Value = Me.[DVDID]
Forms("00 upc create").Controls("group 1").Value = 1
Forms("00 upc create").Controls("GROUP 2").Value = 3
Forms("00 upc create").Controls("PRICE").Value = Me.Text229
End If
Exit_Command220_Click:
Exit Sub
Err_Command220_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command220_Click
End Sub
Private Sub Command220_Click()
On Error GoTo Err_Command220_Click
If Me.Form("00 upc creatED").Controls("group 2").Value = 3 Then
MsgBox ("Already created! Try Again.")
Else
DoCmd.OpenForm "00 upc create", , , ""
Forms("00 upc create").Controls("dvd release").Value = Me.[DVDID]
Forms("00 upc create").Controls("group 1").Value = 1
Forms("00 upc create").Controls("GROUP 2").Value = 3
Forms("00 upc create").Controls("PRICE").Value = Me.Text229
End If
Exit_Command220_Click:
Exit Sub
Err_Command220_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command220_Click
End Sub