Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

How to program for a matrix

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karl H - 16 Jan 2006 07:11 GMT
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
Dirk - 16 Jan 2006 11:02 GMT
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.

> 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"
[quoted text clipped - 9 lines]
> Thank you for any help you can provide,
> Karl
Karl H - 16 Jan 2006 15:40 GMT
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
John Nurick - 16 Jan 2006 19:58 GMT
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.

>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"
[quoted text clipped - 9 lines]
>Thank you for any help you can provide,
>Karl

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Karl H - 16 Jan 2006 20:09 GMT
Thank you, John,
I'll give that a try.
Karl
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.