Data Entry Subform

M

Marin Kostov

Open the Online Help and type BeforeUpdate. This will display you an
explanation and Example...

Here is the sample code.

Private Sub ProductName_BeforeUpdate(Cancel As Integer)
If(Not IsNull(DLookup("[ProductName]", _
"Products", "[ProductName] ='" _
& Me!ProductName & "'"))) Then
MsgBox "Product has already been entered in the database."
Cancel = True
Me!ProductName.Undo
End If
End Sub
 
J

JustMe

When June gets here your question might be answered.
Set your Date correctly... Duh!
 
A

arm

Hello,

Could anyone help me please? I have a subform use as a data entry of
materials for a particular order number. The subform is set to 'continuous
form' as its default view. In the subform I have a "Before Update" event
that validates if the new entered material has been entered previously. If
ever the new material entered already exist it will display a notice or
message. What my problem is, I would like to automatically cancel the entry
made then go to the existing record to update.
 

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

Top