
Originally Posted by
Toyman
I am assuming your main form, "Sales" is unbound, and that is why you are using a "save" button to save the record. If this is so, put this code on the "save" button right before it initiates the "save" codes.
Dim sMacID as Integer 'assuming the Machine ID is a number field. If it is a text field change the declearation to "string"
sMacID = Nz(Me![Sales Lines].Form![Machine ID],0)
if sMacID = 0 then 'no machine id or no record entered
Msgbox "You must enter at least one sales line", vbInformation, "No Sales Entered"
Me![Sales Lines].Form![Machine ID].SetFocus 'sets the focus to the mac ID field
Exit Sub 'exits the code
End if