I am working with two tables for the first time… Glassing_Yield and Glassing_Inspection
I used Database Tools Relationships to join the tables using the field Glassing_Lot that exists in both tables.
On my form the operator uses a combo box to select the Date_Time, Glassing_Lot, PN, and Starting Qty from Glassing_Yield. The info is displayed to the operator.
The operator then enters the End Qty and Operator.
I use this code to save the record to Glassing_Inspection:
Private Sub Save_and_exit_Click()
Dim OkToExit As Boolean
OkToExit = False
OkToExit = CheckDataBeforeSaveAndExit()
If OkToExit = True Then
![Date_Time] = Now()
![Operator] = Me.lstOperator
![Glassing_Lot] = Me.txtGlassing_Lot
![Yield] = Me.txtEndQty
OkToExit = PrintLabels()
The record saves correctly to Glassing_Inspection. Now I want to print a report(really it’s a label) using that record. The report also needs to get the PN from Glassing_Yield that matches the Glassing_Lot. And finally also print the sum of quantities from End Qty in Glassing_Yield for that Glassing_Lot...
The report Control Source is Glassing_Inspection.
In the report I have:
Text Box Control Source
txtStartQty =DSum("[End_Qty]","[Glassing_Yield]","[Glassing_Lot] = '" & Me.txtGlassing_Lot & "'")
In the code above PrintLabels() executes this code:
DoCmd.OpenReport "Glassing Inspection Label", acViewNormal, , "[ID]=" & Me.ID
The report fails with the error “No Record Found” on that line.
I hope in all this info you can tell me where I went wrong.