G
Gary Dolliver
Hi all,
I am using an SQL command to update a record and can get it to do so
perfectly. However, I would like to put in an error check that will check to
see if a value already exists so that nothing will be overwritten. My SQL is
as follows:
DoCmd.FindRecord "Item_ID", , True, , True
DoCmd.RunSQL "UPDATE [IKR Items] " & _
"SET [IKR Items].Shipped = Date(), [IKR Items].[Shipped
By] = Employee.Value, [IKR Items].[Shipping Number] = Now() " & _
"WHERE [IKR Items].[Item #] = Item_ID "
What is happening is there is a combo box that has a field (Item_ID) that is
scanned via a bar code scanner - it fires an AfterUpdate event (above) and
updates the fields Shipped, Shipped By, and Shipping Number. What I would
like it to do is to update if all 3 fields are null, but to pop up a message
warning and not do any updates if there are values in these fields.
Please help, thanks!
-gary
I am using an SQL command to update a record and can get it to do so
perfectly. However, I would like to put in an error check that will check to
see if a value already exists so that nothing will be overwritten. My SQL is
as follows:
DoCmd.FindRecord "Item_ID", , True, , True
DoCmd.RunSQL "UPDATE [IKR Items] " & _
"SET [IKR Items].Shipped = Date(), [IKR Items].[Shipped
By] = Employee.Value, [IKR Items].[Shipping Number] = Now() " & _
"WHERE [IKR Items].[Item #] = Item_ID "
What is happening is there is a combo box that has a field (Item_ID) that is
scanned via a bar code scanner - it fires an AfterUpdate event (above) and
updates the fields Shipped, Shipped By, and Shipping Number. What I would
like it to do is to update if all 3 fields are null, but to pop up a message
warning and not do any updates if there are values in these fields.
Please help, thanks!
-gary