Hi All,
I have a form with fields [RER] and [SN]. The record source is Table_1.
There is also a subform that has fields [RER] and [SN]. The record source is Query_1. Query_1 is a Select Query from Table_1.
subform is linked to parentform on the SN field.
I have a macro On Current event of parentform that filters subform:
[RER]<>[Forms].[Main_F].[RER] -----> (Main_F is parentform)
ID RER SN
1 800 135001
2 801 135002
3 802 135003
4 803 135001
So if the parentform is showing record ID=1 then I want the subform to show record ID=4 ONLY (in this example).
(This sound like a daft system but it's used for checking previous returns on units with that SN but we don't want to show the same record as the parentform as that's the one we're already looking at... with me? )
Now the problem... In form view it filters straight away with no issues and working as I like.
However as soon as I look in datasheet view and click the plus sign to show the subform results it shows all records where SN is equal but has not applied the filter to the RER field. If I then click on another record it will then apply the filter. I was wondering if there is a way of the filter being applied as I click the plus sign? I've tried On Current, On Load and On Got Focus events for both parentform and subform... Any ideas?
Many thanks,
I have a form with fields [RER] and [SN]. The record source is Table_1.
There is also a subform that has fields [RER] and [SN]. The record source is Query_1. Query_1 is a Select Query from Table_1.
subform is linked to parentform on the SN field.
I have a macro On Current event of parentform that filters subform:
[RER]<>[Forms].[Main_F].[RER] -----> (Main_F is parentform)
ID RER SN
1 800 135001
2 801 135002
3 802 135003
4 803 135001
So if the parentform is showing record ID=1 then I want the subform to show record ID=4 ONLY (in this example).
(This sound like a daft system but it's used for checking previous returns on units with that SN but we don't want to show the same record as the parentform as that's the one we're already looking at... with me? )
Now the problem... In form view it filters straight away with no issues and working as I like.
However as soon as I look in datasheet view and click the plus sign to show the subform results it shows all records where SN is equal but has not applied the filter to the RER field. If I then click on another record it will then apply the filter. I was wondering if there is a way of the filter being applied as I click the plus sign? I've tried On Current, On Load and On Got Focus events for both parentform and subform... Any ideas?
Many thanks,