John Zelmer
Registered User.
- Local time
- Today, 09:59
- Joined
- May 13, 2015
- Messages
- 39
Hello,
In an inherited database's module I'm trying to create one function out of 10 almost identical ones. I know how to do this except for this:
In the code of every one of the 10 functions there is the following field reference:
Forms![MyMainForm]![MySubForm].Form![MyFieldName08].Requery (the number part 08 is different for every function)
(There are 10 MyFieldNames fields (same field names, except for the number part) in the form relating to corresponding fields in a table. I know it's not a normalized db design but changing that is too big of a job to tackle right now.)
In order to make it work I need to be able to refer to the '08' part from MyFieldName08 as a variable. So something like:
Function MyFunction(strFldNr as string) 'value 08 for instance for strFldNr
Forms![MyMainForm]![MySubForm].Form!["MyFieldName" & strFldNr].Requery
Obviously, this doesn't work. How can I refer to the specific field using a variable?
Thanks in advance for your help,
John
In an inherited database's module I'm trying to create one function out of 10 almost identical ones. I know how to do this except for this:
In the code of every one of the 10 functions there is the following field reference:
Forms![MyMainForm]![MySubForm].Form![MyFieldName08].Requery (the number part 08 is different for every function)
(There are 10 MyFieldNames fields (same field names, except for the number part) in the form relating to corresponding fields in a table. I know it's not a normalized db design but changing that is too big of a job to tackle right now.)
In order to make it work I need to be able to refer to the '08' part from MyFieldName08 as a variable. So something like:
Function MyFunction(strFldNr as string) 'value 08 for instance for strFldNr
Forms![MyMainForm]![MySubForm].Form!["MyFieldName" & strFldNr].Requery
Obviously, this doesn't work. How can I refer to the specific field using a variable?
Thanks in advance for your help,
John
Last edited: