I am having trouble getting a subform to be recognized with a query and after update.
I want to stay with an Access criteria query and avoid vba and sql.
I will first show you what works and then the part that does not work.
1 - If I put my unbound lookup fields on the parent form and use the below criteria
in the underlying query, I CORRECTLY get my desired records.
[Forms]![frmCustomer]![cboCusStatus2]
The unbound field in the parent form has the following after update.
Private Sub cboMailRegion2_AfterUpdate()
On Error GoTo Err_cboMailRegion2_Click
Me.RecordSource = "Select * From [qryCustomerInfoMailerRegion2]"
Exit_cboMailRegion2_Click:
Exit Sub
Err_cboMailRegion2_Click:
MsgBox Err.Description
Resume Exit_cboMailRegion2_Click
End Sub
Works fine.
2 - However, to give me me more space on the parent form, i want to show the lookup field instead
by using a BUTTON on the parent form and have a subform popup called frmMoreLookups.
So I thought that I only needed to add the subform frmMoreLookups into query criteria. But it does not work. I get no records.
CusStatus query field criteria:
[Forms]![frmCustomer]![frmMoreLookups].[Form]![cboCusStatus2]
What am I doing wrong?
Thanks alot.
I want to stay with an Access criteria query and avoid vba and sql.
I will first show you what works and then the part that does not work.
1 - If I put my unbound lookup fields on the parent form and use the below criteria
in the underlying query, I CORRECTLY get my desired records.
[Forms]![frmCustomer]![cboCusStatus2]
The unbound field in the parent form has the following after update.
Private Sub cboMailRegion2_AfterUpdate()
On Error GoTo Err_cboMailRegion2_Click
Me.RecordSource = "Select * From [qryCustomerInfoMailerRegion2]"
Exit_cboMailRegion2_Click:
Exit Sub
Err_cboMailRegion2_Click:
MsgBox Err.Description
Resume Exit_cboMailRegion2_Click
End Sub
Works fine.
2 - However, to give me me more space on the parent form, i want to show the lookup field instead
by using a BUTTON on the parent form and have a subform popup called frmMoreLookups.
So I thought that I only needed to add the subform frmMoreLookups into query criteria. But it does not work. I get no records.
CusStatus query field criteria:
[Forms]![frmCustomer]![frmMoreLookups].[Form]![cboCusStatus2]
What am I doing wrong?
Thanks alot.