chrisjames25
Registered User.
- Local time
- Today, 17:03
- Joined
- Dec 1, 2014
- Messages
- 404
Hi. I have now got my accmdfiltermenu command working on my continuous form but have encountered a problem with my code:
Works great. The line to go to first record is so the filter menu always appears at top of screen near the label title as opposed to whatever record i am on in the form (which has been made to look like datasheet).
Issue is if i choose a blank from the filter options it returns no records as i would expect. But then when i double click the label again to reenter the filtermenu it errors out on
Assume this is because there is no records visible so cant go to the record as instructed.
What is the fix for this. Could i do a dcount of current records and say if greather than zero run normal code but if 0 just do the filter? Is that the best approach?
Code:
DoCmd.GoToControl "Txt_Column1"
DoCmd.GoToRecord , "", acFirst
DoCmd.RunCommand acCmdFilterMenu
Works great. The line to go to first record is so the filter menu always appears at top of screen near the label title as opposed to whatever record i am on in the form (which has been made to look like datasheet).
Issue is if i choose a blank from the filter options it returns no records as i would expect. But then when i double click the label again to reenter the filtermenu it errors out on
Code:
DoCmd.GoToControl "Txt_Column1"
Assume this is because there is no records visible so cant go to the record as instructed.
What is the fix for this. Could i do a dcount of current records and say if greather than zero run normal code but if 0 just do the filter? Is that the best approach?