H
Holly H.
I have a field that I want to have check another table upon
the loss of focus.
I have it working and it finds out if there is a record
matching the open record in another table and appends a
field in the matching record.
If it doesn't find a matching record, it pops up the screen
saying it will append 0 records and asks if it is OK.
What I need for it to do is not run the append query if
there is no matching record.
Here is the Event code as it currently is:
Private Sub REPORT_DATE_LostFocus()
Dim db As [Form_Open Job DB]
Dim strSQL As String
strSQL = "UPDATE [Sample Log] " & " SET [REPORT DATE] = #"
& Me![REPORT DATE] _
& "# WHERE [REFERENCE NUMBER] = " & Me![REFERENCE
NUMBER]
DoCmd.RunSQL strSQL, dbFailOnError ' db.RecordsAffected
has the number of updated records
Set db = Nothing
End Sub
Please let me know how I might change this code to ignore
the update command if there is no matching file.
the loss of focus.
I have it working and it finds out if there is a record
matching the open record in another table and appends a
field in the matching record.
If it doesn't find a matching record, it pops up the screen
saying it will append 0 records and asks if it is OK.
What I need for it to do is not run the append query if
there is no matching record.
Here is the Event code as it currently is:
Private Sub REPORT_DATE_LostFocus()
Dim db As [Form_Open Job DB]
Dim strSQL As String
strSQL = "UPDATE [Sample Log] " & " SET [REPORT DATE] = #"
& Me![REPORT DATE] _
& "# WHERE [REFERENCE NUMBER] = " & Me![REFERENCE
NUMBER]
DoCmd.RunSQL strSQL, dbFailOnError ' db.RecordsAffected
has the number of updated records
Set db = Nothing
End Sub
Please let me know how I might change this code to ignore
the update command if there is no matching file.