Thanks Tony.
I understand what you are telling me to do, i think.
I want to show you the code that i have, maybe you can use it to help me alittle more.
Private Sub cmdGenCode_Click()
On Error GoTo Err_cmdGenCode_Click
Dim stDocName As String
stDocName = "Code Generatore"
DoCmd.RunMacro stDocName
Exit_cmdGenCode_Click:
Exit Sub
Err_cmdGenCode_Click:
MsgBox Err.Description
Resume Exit_cmdGenCode_Click
End Sub
That Macro runs this Query:
UPDATE (StrainCodes INNER JOIN InoculationRecord ON StrainCodes.[Strain ID] = InoculationRecord.Strain) INNER JOIN spawntransferunits ON InoculationRecord.TransID = spawntransferunits.inoculationid SET spawntransferunits.MasterCode = Format([seeddate],"mmddyy") & "-" & [species code] & "-" & [strain code] & "-" & Right("00" & [unitlotnum],2) & [transvessel];
So Do I just add the where clause to the update query, WHERE MasterCode = 0? (Mastercode is my default 0 field before updating)