Fetching System Parameters for Form Input

GK in the UK

Registered User.
Local time
Today, 14:07
Joined
Dec 20, 2017
Messages
281
OK , humour me before I tie myself in knots with this one.

I have a hierarchy of three forms, an index form, where documents are added, a documents form, and a transaction lines form.

To add a transaction line, the document form will be open, and so will the index form.

For transaction lines, the user has the option of entering two analysis codes which are simple look-ups from a table.

I want to set a system option which optionally forces the user to enter one or both analysis codes.

I have a function fSysOption which fetches the parameter value from tblSysOptions by means of a Dlookup.

So I can force the user to enter an analysis code like this:

IF fSysOption("ForceAnalysis1Input") = true then
' force the input of a valid analysis code

I can put this code behind the transaction line form, but for every transaction entered Access will go to tblSysOptions twice. So could be a dozen or more times for a single document.

My thinking is to put two hidden text boxes on the index form, fetch the parameter values from tblSysOptions when the index form is opened and store them in the hidden text boxes. Then get the values by form reference to the index form. That will be more efficient, won't it?

Am I on the right lines here ? Any better ways of doing it ?
 
That sounds pretty sensible, although I don't think the overhead is probably worth worrying about, unless you have dozens of lookups to perform.
 

Users who are viewing this thread

Back
Top Bottom