ted.martin
Registered User.
- Local time
- Today, 18:36
- Joined
- Sep 24, 2004
- Messages
- 743
I have a series of forms which I have named (say) F1-XXX, F2-YYY and F3-ZZZ. As I want them to open in sequence I have put two command buttons on the form, one cmdPrevious and one cmdNext.
The alpha part of the form name will be vary from form to form. If form F1-XXX is open, when I press cmdNext I want form F2-YYY to open.
If there was a command like Docmd.OpenForm Like "F2*" then this would do it but of course there isn't.
The only thing I can think of is store all the form names in a table with 2 fields (FormID and FormName) and essentially do a DLOOKUP to find the next form name.
e.g. Docmd.OpenForm (Dlookup("[FormName]","myForms","FormID = 'F2'"))
Can anyone think of a quicker way to open a form with a wildcard in the Form name?
The alpha part of the form name will be vary from form to form. If form F1-XXX is open, when I press cmdNext I want form F2-YYY to open.
If there was a command like Docmd.OpenForm Like "F2*" then this would do it but of course there isn't.
The only thing I can think of is store all the form names in a table with 2 fields (FormID and FormName) and essentially do a DLOOKUP to find the next form name.
e.g. Docmd.OpenForm (Dlookup("[FormName]","myForms","FormID = 'F2'"))
Can anyone think of a quicker way to open a form with a wildcard in the Form name?