HI (again)
I have data to be inserted into record.
The record will be in one of two tables.
I have the vba to update the table by searching the table and editing the field
If the record is not in the second table Access stops at rst.movefirst with an error message. (because no record)
How can I error trap this event?
If n = 2 Then SqlStr = "SELECT tblMachine1.MachinePhone, tblMachine1.SerialNo FROM tblMachine1 WHERE (((tblMachine1.SerialNo)= '" & SearchStr & "'));"
Set rst = dbs.OpenRecordset(SqlStr)
rst.OpenRecordset
rst.MoveFirst
rst.Edit
rst.Fields(1) = txtMachinePhone
rst.Update
Many thanks (again)
Telephoto
I have data to be inserted into record.
The record will be in one of two tables.
I have the vba to update the table by searching the table and editing the field
If the record is not in the second table Access stops at rst.movefirst with an error message. (because no record)
How can I error trap this event?
If n = 2 Then SqlStr = "SELECT tblMachine1.MachinePhone, tblMachine1.SerialNo FROM tblMachine1 WHERE (((tblMachine1.SerialNo)= '" & SearchStr & "'));"
Set rst = dbs.OpenRecordset(SqlStr)
rst.OpenRecordset
rst.MoveFirst
rst.Edit
rst.Fields(1) = txtMachinePhone
rst.Update
Many thanks (again)
Telephoto