I have a subform bound to the main form by two primary keys - Xfile and issueno.
I have a routine on a subform field that inserts a record in a table if no matching records found using
If DCount("*", "qrybom", "partno = '" & partno & "'") = 0 Then
If MsgBox("This is a New Part - Do You Wish To Add?", _
vbYesNo, "Project Costing Database") = vbNo Then
Exit Sub
Else: DoCmd.RunSQL "INSERT INTO tblnewparts ( partno ) " _
& "Values ('" & partno & "')"
End If
End If
End Sub
This works ok but I really need to include the Xfile and issueno fields on the main form so that the "new" record is bound to that record. Can any one suggest a way I can achieve this??
Cheers
Dave
I have a routine on a subform field that inserts a record in a table if no matching records found using
If DCount("*", "qrybom", "partno = '" & partno & "'") = 0 Then
If MsgBox("This is a New Part - Do You Wish To Add?", _
vbYesNo, "Project Costing Database") = vbNo Then
Exit Sub
Else: DoCmd.RunSQL "INSERT INTO tblnewparts ( partno ) " _
& "Values ('" & partno & "')"
End If
End If
End Sub
This works ok but I really need to include the Xfile and issueno fields on the main form so that the "new" record is bound to that record. Can any one suggest a way I can achieve this??
Cheers
Dave