Check text field value against underlying table or query of combo box

  • Thread starter Thread starter antcraw
  • Start date Start date
A

antcraw

Hello,
I have a form on which the user can enter new records or update
existing ones.
If the user enters a new record on the form, I would like to have an
'After Update' event on one of the text fields, which is the item# to
check if the value entered already exists in the underlying table,
tbl_item. How can I call the table from the 'After Update' event of
the text field and check for that value in the table?

Thanks in advance.

Regards,
A. Crawford
 
I have a form on which the user can enter new records or update
existing ones.
If the user enters a new record on the form, I would like to have an
'After Update' event on one of the text fields, which is the item# to
check if the value entered already exists in the underlying table,
tbl_item. How can I call the table from the 'After Update' event of
the text field and check for that value in the table?

If Me.NewRecord Then
If DCount("*", "table", "[item#]=" & Me.textbox)= 0 Then
' item is not in table
. . .
Else
' item already in table
. . .
End If
End If
 
Back
Top