Have you tried anything? I'm guessing not.
Here are some tips rather than a complete solution.
Use the order number to find the OMID.
Delete from Table 2 where ORDERNOREF = OMID
Delete from Table 1 where OMID = OMID
Another option would be to
define a relationship in SQL, so that when you
delete from table 1 the delete cascades to table 2, in turn deleting the lines.
The third option, is a take on the first one where you
delete from table 2 where ORDERNOREF in (Select OMID from Table 1 where ORDERNO = your selected value)
delete from table 1 where ORDERNO = your selected value