The Current event fires whenever you move to a new record. Do you in
fact want to overwrite whatever is currently in ServiceTicket with
that from the other form? Suppose you want this form to have all
records visible - this code will overwrite the ServiceTicket in every
record that the user visits.
John, the records in the pop-up form ServiceNotes displays the
current displayed serviceticket number on the underlying form.
Ok, as far as that goes, I can see the proper record for the proper
car in service. If it came in for belts, then decided it allso needed
a tune-up, for instance, it can be added in this pop-up form, for
however many service details need to be added.
That part is ok, it's just that the "next record" button wants to add
a new record.
I have now removed the primary key, and IT STILL does it !
Could you post the code which OPENS this form? Presumably it's on the
other form. THAT code is what's setting the Filter, I'm sure.
What opens the pop-up form is the botton's on click event; here's the
code for that:
Private Sub cmdServiceDetails_Click()
On Error GoTo Err_cmdServiceDetails_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Service Details"
'stLinkCriteria = "[ServiceTicket]=" &
Forms![CustomerData].[Service].Forms[ServiceTicket]
'stLinkCriteria = "ServiceTicket =
Forms!CustomerData!CustomerCarData!Service!ServiceTicket"
stLinkCriteria = "[ServiceTicket]=" & Me![ServiceTicket]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdServiceDetails_Click:
Exit Sub
Err_cmdServiceDetails_Click:
MsgBox Err.Description
Resume Exit_cmdServiceDetails_Click
End Sub
The Record Source is "ServiceNotes" (table)
The Formula for the "ext" field is: =[Qty]*[Price]
I placed that expression right in the "ext" field, which is also the
Control Source
This will calculate the Ext but will not store it in the table. That's
what I'd recommend, unless the price may change and you want to store
the Ext. If that is the case, use the Form's BeforeUpdate event to
transfer the calculated value to a (perhaps invisible) control bound
to the Table's Ext field.