G
Guest
With these tables: tblShipments (main), tblInvoices (sub)
and an unbound combo in the header: cboShowShip
I'm using the following code, adapted from Allen Browne's example for this
problem:
Private Sub cboShowShip_AfterUpdate()
Dim strSQL As String
If IsNull(Me.cboShowShip) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "tblShipments"
Else
strSQL = "SELECT DISTINCTROW tblShipments.* FROM tblShipments " & _
"INNER JOIN tblInvoices ON " & _
"tblShipments.ShipmentID = tblInvoices.InvoiceID " & _
"WHERE tblInvoices.InvoiceID = " & Me.cboShowShip & ";"
Me.RecordSource = strSQL
End If
End Sub
Using a test invoice number in the subform, which appears in two different
shipments, I enter the number, but the result is a blank record, filter count
1. I want to see the two records for which that invoice number appears in
the subform of course. Any ideas here for me?
tia
and an unbound combo in the header: cboShowShip
I'm using the following code, adapted from Allen Browne's example for this
problem:
Private Sub cboShowShip_AfterUpdate()
Dim strSQL As String
If IsNull(Me.cboShowShip) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "tblShipments"
Else
strSQL = "SELECT DISTINCTROW tblShipments.* FROM tblShipments " & _
"INNER JOIN tblInvoices ON " & _
"tblShipments.ShipmentID = tblInvoices.InvoiceID " & _
"WHERE tblInvoices.InvoiceID = " & Me.cboShowShip & ";"
Me.RecordSource = strSQL
End If
End Sub
Using a test invoice number in the subform, which appears in two different
shipments, I enter the number, but the result is a blank record, filter count
1. I want to see the two records for which that invoice number appears in
the subform of course. Any ideas here for me?
tia