I
Isis
I am trying to move a local function to a Global Module so that I can use
it from different Forms. I have been trying to find the Syntax for
retrieving values using both the "Me.Controls(strFieldName).SetFocus"
method and the DLookup Function. Using the SetFocus method I had been
using the following code;
(assign value to strFieldName).....
Me.Controls(strFieldName).SetFocus
strValue = Me.Controls(strFieldName).Text
Used fro the Global Function this gives and error about using "Me."
Using the DLookup Method I would use something like this;
(assign value to strFieldName).....
strValue = DLookup([strFieldName], "Colours", "[Type] = CURRENT VALUE OF
TYPE CONTROL")
The Me.Controls method looks better to me as it can be generic for any
form I have open but it does not seem to like it - does that mean I
cannot use it ?
I can't get the syntax of the DLookup call right to use the values on the
current record open in the Form.
Any help appreciated.
Thanks
it from different Forms. I have been trying to find the Syntax for
retrieving values using both the "Me.Controls(strFieldName).SetFocus"
method and the DLookup Function. Using the SetFocus method I had been
using the following code;
(assign value to strFieldName).....
Me.Controls(strFieldName).SetFocus
strValue = Me.Controls(strFieldName).Text
Used fro the Global Function this gives and error about using "Me."
Using the DLookup Method I would use something like this;
(assign value to strFieldName).....
strValue = DLookup([strFieldName], "Colours", "[Type] = CURRENT VALUE OF
TYPE CONTROL")
The Me.Controls method looks better to me as it can be generic for any
form I have open but it does not seem to like it - does that mean I
cannot use it ?
I can't get the syntax of the DLookup call right to use the values on the
current record open in the Form.
Any help appreciated.
Thanks