Vote count: 0
I have the following vba code to check wether a product is already selected on a subform. And then alert the user.
Private Sub ProdId_Combo_BeforeUpdate(Cancel As Integer)
Dim icount As Long
icount = Nz(DCount("[ProdID]", "ProdRestockDetails", "[ProdID]=" & Me.ProdID & " AND RestockID=" & Me.RestockID, 0))
If icount <> 0 Then
MsgBox "this item has already been selected."
Cancel = True
Undo
End If
End Sub
But it throws an error. Can someone help me set it correctly please?
asked 28 secs ago
How to check if an item has already been selected on a subform?
Aucun commentaire:
Enregistrer un commentaire