I set the Default property of the unbound text boxes to 19, 7, and 3.
I set "Table1.Table2ID_FK" to NULL when the "PRUNE" button is clicked. If you DON'T want the field to be set to NULL, Delete or comment out the BLUE line
Code:
<snip>
'get variables from Form
X = Me.tbX
Y = Me.tbY
Z = Me.tbZ
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'Every time you click the "PRUNE" button, Table1 Field "Table2ID_FK" is updated to NULL.
' if this is **NOT** correct, comment out the following line
d.Execute "UPDATE Table1 SET Table1.Table2ID_FK = Null;", dbFailOnError
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<snip>
I moved the code to write Table2 PK field to Table1 FK field up a few lines:
Code:
<snip>
'Similar means Total Differences <= threshold x OR Big Differences <= Threshold y
bSimilar = (TotalDiffs <= X) Or (BigDiffs <= Y)
If bSimilar Then
'if SIMILAR, update current Table1 record with PK from table2
t1.Edit
t1!Table2ID_FK = t2!Table2ID_PK
t1.Update
'if similar then move to last T2 record
t2.MoveLast
End If
t2.MoveNext
'reset diff variables
TotalDiffs = 0
BigDiffs = 0
tmp = 0
Loop 'inner loop**
<snip>
If you decide to delete all records from Table2, you SHOULD do a "Compact and Repair" before clicking the "Prune" button.
This is to reset the autonumber initial number.
Maybe.....I hope....fingers crossed......