Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bookmark Records in Form and Subform

Status
Not open for further replies.

GMH

MIS
Aug 3, 2001
1
GB
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top