tammyl
02-11-2009, 01:02 AM
Hi,
I'm trying to filter my subform records via two combo boxes from the main form. Catch is, i want the option to leave either of the combo selections blank (null).
That is;
- list all records that match Project Code and ALL vendors, if cboVendor is null
OR
- list all records that match Vendor if cboProjectCode is null.
STRUCTURE
tblProject - ProjectCode
tblInvoices - ProjectCode
MainForm = fInv
ComboBox 1 = cboProjectCode
combobox 2 = cboVendor
Subform = fsubInv
Relationship link is the ProjectCode field.
I'm currently using the Link Master & Link Child fields under the subform, as follows.
Link Master Fields = ProjectCode;cboProjectCode;cboVendor
Link Child Fields = ProjectCode;ProjectCode;Vendor
For both combo's i have in the AfterUpdate event
Me.fsubInv.Requery
1) Current setup not working
2) Not sure this is the best way to do this filter for subform???
3) Current setup doesn't allow either field to remain blank
4) it doesn't show any of the invoice information, only the vendor name is displayed in the subform.
5) requery in my Afterupdate doesn't appear to be working.
Without having a 'Run Filter' button (not my preference, as it's another keystroke for the user)
I may need to run the requery twice, first when combo (cboProjectCode) is selected, then again with the selection from combo (cboVendor)
Once i get the basics working, i also wish to have a tick box to only show active records (where paid date is blank)
Hopefully this is relatively straight forward for the Access guru's and someone is happy to help.
Any advise or help appreciated.
Thanks
tammyl
I'm trying to filter my subform records via two combo boxes from the main form. Catch is, i want the option to leave either of the combo selections blank (null).
That is;
- list all records that match Project Code and ALL vendors, if cboVendor is null
OR
- list all records that match Vendor if cboProjectCode is null.
STRUCTURE
tblProject - ProjectCode
tblInvoices - ProjectCode
MainForm = fInv
ComboBox 1 = cboProjectCode
combobox 2 = cboVendor
Subform = fsubInv
Relationship link is the ProjectCode field.
I'm currently using the Link Master & Link Child fields under the subform, as follows.
Link Master Fields = ProjectCode;cboProjectCode;cboVendor
Link Child Fields = ProjectCode;ProjectCode;Vendor
For both combo's i have in the AfterUpdate event
Me.fsubInv.Requery
1) Current setup not working
2) Not sure this is the best way to do this filter for subform???
3) Current setup doesn't allow either field to remain blank
4) it doesn't show any of the invoice information, only the vendor name is displayed in the subform.
5) requery in my Afterupdate doesn't appear to be working.
Without having a 'Run Filter' button (not my preference, as it's another keystroke for the user)
I may need to run the requery twice, first when combo (cboProjectCode) is selected, then again with the selection from combo (cboVendor)
Once i get the basics working, i also wish to have a tick box to only show active records (where paid date is blank)
Hopefully this is relatively straight forward for the Access guru's and someone is happy to help.
Any advise or help appreciated.
Thanks
tammyl