Subform with PT query not working (1 Viewer)

Kayleigh

Member
Local time
Today, 12:39
Joined
Sep 24, 2020
Messages
706
Hi
I'm at my wits end with an issue I'm having with subform. Hope someone can shed light on this please.
I have been trying to add a subform to a main form which has a PT query as its recordsource and got an error. I've done research and found the reason why it happens here: https://stackoverflow.com/questions...hen-it-is-bound-to-a-specific-stored-procedur
I've tried the workaround several times but the subform is still coming up blank even when I've changed source object in VBA.
My code is:
Code:
    Me.frmPaymentsCashPSF1.SourceObject = ""
    
   With CurrentDb.QueryDefs("qryCashProjectionPayments")
        .SQL = "SELECT qryCashProjection.fldOrderID, qryCashProjection.cfTotalPaidMz, qryCashProjection.cfTotalPaidFinance, qryCashProjection.cfTotalPaidTfr, qryCashProjection.cfMzOverPay, qryCashProjection.cfFinanceBal, qryCashProjection.cfTfrBal, qryCashProjection.cfTfrOverPay, qryCashProjection.cfTfrOverPayVat, qryCashProjection.cfMzBal, qryCashProjection.cfBalance " & vbCrLf & _
        "FROM qryCashProjection " & vbCrLf & _
        "WHERE (((qryCashProjection.fldOrderID)=" & Me.fldOrderID & "));"
    End With

     Me.frmPaymentsCashPSF1.SourceObject = "frmPaymentsCashPSF"

The subform object is: frmPaymentsCashPSF1
and the subform containing data is: frmPaymentsCashPSF

Any ideas why this subform still doesn't work?
 

Minty

AWF VIP
Local time
Today, 12:39
Joined
Jul 26, 2013
Messages
10,371
Can you show how/where/what the subform recordsource is or how it's set?
 

Users who are viewing this thread

Top Bottom