How to program for a matrix

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In order to adjust printing of a certificate, I have written a number of
different reports with different margins. The user will input an "X" and "Y"
adjustment, and the output will be one of 36 different sets of reports.

I'm looking for the best way to program this. I could do
Case of X1 with 6 cases of Y1-Y6, but it seems like there must be a simpler
answer.

Then I want the printing adjustment to be remembered and used when the main
form re-opens each time, unless the print adjustment is changed.

Thank you for any help you can provide,
Karl
 
If it's only 36 cases, you are not going to expand the number of cases and
are not likely to have to write more of these case tructures in your code I
would just take a deep breath and code them the hard way.
If you would have over 100's of cases I would suggest writing a nice class
structure to define these reports but with only 36 that would take longer
than just writing the cases out.
 
Thank you, Dirk.
Would you put it on the same form, making it less necessary to pass
variables to another part of the code?

Is there any trouble making the setting be remembered from one use to the
next?

Thank you,
Karl
 
Hi Karl,

I'd think in terms of a table with a structure like this

tblAdjustments
XAdj*
YAdj*
ReportName
...other fields

containing 36 records.

Then if you have comboboxes cboXAdj and cboYAdj on your form frmF, you
can use a query like this (or the equivalent DLookup call) to pull the
relevant values out of the table:

SELECT ReportName
FROM tblAdjustments
WHERE (XAdj = [Forms]![frmF]![cboXAdj])
AND (YAdj = [Forms]![frmF]![cboYAdj])
;

To store the last-used values ready for next time, one common technique
is to use a "settings" table. In the form's Close event procedure, write
the current settings to records in the table; in its Open procedure,
read them and apply them.
 
Back
Top