Kayleigh
Member
- Local time
- Today, 00:52
- Joined
- Sep 24, 2020
- Messages
- 709
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:
The subform object is: frmPaymentsCashPSF1
and the subform containing data is: frmPaymentsCashPSF
Any ideas why this subform still doesn't work?
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?