Please help me – I’m not sure where to start……
I have a form (frm_CustomerPartFcastInput) that has a customer name field in and a subform (frm_CustomerPartFcastInputSubform) which lists all available products and a forecast quantity. I have set up a filter on the subform properties that allows just those products with a forecast to be shown when a button is clicked on the main form. When the button is clicked again, the filter is removed.
I want the current record to still be displayed both for the customer and the part when the filter is applied or removed – what happens at the moment is that it goes to the first record on both the main and sub forms.
I believe using bookmarks is the best way forward but I can’t seem to get anywhere. Do I need a bookmark for both the form and subform? Here is my code that just applies and removes the filter (ClickValue and FilterBulletLabel.Caption are initialised on Form_Load):-
Private Sub FilterBullet_Click()
If ClickValue = 0 Then
'filter according to whether there is any forecast for part (this filter is set in the property of
'the form itself)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
'change value of ClickValue
ClickValue = 1
'change value of FilterBulletLabel
FilterBulletLabel.Caption = "remove filter to display all parts"
ElseIf ClickValue = 1 Then
'remove any filter applied
DoCmd.ShowAllRecords
'change value of ClickValue
ClickValue = 0
'change value of FilterBulletLabel
FilterBulletLabel.Caption = "filter on parts with forecast"
End If
End Sub
Any help would be much appreciated.
I have a form (frm_CustomerPartFcastInput) that has a customer name field in and a subform (frm_CustomerPartFcastInputSubform) which lists all available products and a forecast quantity. I have set up a filter on the subform properties that allows just those products with a forecast to be shown when a button is clicked on the main form. When the button is clicked again, the filter is removed.
I want the current record to still be displayed both for the customer and the part when the filter is applied or removed – what happens at the moment is that it goes to the first record on both the main and sub forms.
I believe using bookmarks is the best way forward but I can’t seem to get anywhere. Do I need a bookmark for both the form and subform? Here is my code that just applies and removes the filter (ClickValue and FilterBulletLabel.Caption are initialised on Form_Load):-
Private Sub FilterBullet_Click()
If ClickValue = 0 Then
'filter according to whether there is any forecast for part (this filter is set in the property of
'the form itself)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
'change value of ClickValue
ClickValue = 1
'change value of FilterBulletLabel
FilterBulletLabel.Caption = "remove filter to display all parts"
ElseIf ClickValue = 1 Then
'remove any filter applied
DoCmd.ShowAllRecords
'change value of ClickValue
ClickValue = 0
'change value of FilterBulletLabel
FilterBulletLabel.Caption = "filter on parts with forecast"
End If
End Sub
Any help would be much appreciated.