How to store reusable information

smile

Registered User.
Local time
Yesterday, 18:50
Joined
Apr 21, 2006
Messages
212
Hi, I need to store some infomration on my reports like version number, etc.
This need to be changed at once on many reports.

I was thinking to store it in a table, but how do call it?
 
assuming all your reports need to include the same reference (say a version number) have a constants table, with a single row (easiest), anda field called reportversion

then in the open event for a report get the constant

dim reportsuffix as string
reportsuffix = dlookup("reportversion","tblconstants")

'and append this to the basic headercaption

label1.caption = label1.caption & " - " & reportsuffix
 
There's several ways to do it, but one way without requiring any coding at all would be this:

Create a listbox, size it to the textbox, then bind it to a query that retrieve the specific row from the table.

This works OK for one-off solution, and you only need to change the table data to get it updated in all reports. The downside of this, though, is that if you have several data you want to place all over the reports, it can get old fast and troublesome to maintain. In such case, it may be easier to use variables which you can build prior to formatting the report.
 
Well I tried to create a table then use it as for my reports, as you said if I need more data it can be very hard to update as data is stored horizontal and not vertical.
 
Well, personally, if I had more than one constant, I would use a table with more that one row, create a text field as key... Something like this:

tblConstant

Version 12.0
Company Acme Corp
Department Mallets & Anvils Dept



Then I can format as desired, whether by concatenating those variables together or using a listbox to list it.

HTH.
 
Well, personally, if I had more than one constant, I would use a table with more that one row, create a text field as key... Something like this:

tblConstant

Version 12.0
Company Acme Corp
Department Mallets & Anvils Dept



Then I can format as desired, whether by concatenating those variables together or using a listbox to list it.

HTH.

What do you mean more than one row?

I now have a table tbl_dataset. In design view when you enter data in rows later when you fill the table they become columns.

So now I have in design view:

Version
Made by
updated

In table view I have:

Version Made by updated
version 2.0 made by Acme corp updated 2008-08-08

I have to type "headings" back into table.

If I'm going to have more columns it's hard to update because data is listed horizontal. I'm not aware how can I call data from table if I use text as key and for that matter how to display it vertical for easy reading updating?
 
Actually, the design view would look like:

ConstantName: Text
ConstantValue: Text


Then in the table view, it'd be like this:

ConstantName ConstantValue
Version 2.0
Made By Acme Corp
Updated 2008-08-08

Did that help?
 
IT isn't easy to call row2, I get only row 1.

BTW I need this table to hold other info too so while I can include certain columns in certain reports and call row1 I can't call row2.

I link table -> report no queries used here.
 
assuming all your reports need to include the same reference (say a version number) have a constants table, with a single row (easiest), anda field called reportversion

then in the open event for a report get the constant

dim reportsuffix as string
reportsuffix = dlookup("reportversion","tblconstants")

'and append this to the basic headercaption

label1.caption = label1.caption & " - " & reportsuffix

I have table tbl_accountnumber it stores bank account numbers

I have two reports that print invoices one for corporate customers another retail.

The corporate customers report works fine as it pulls data from tbl_accountnumber trough relationship with bank transaction table where bank transaction table is related to tbl_accountnumber.

My problem is with retail report.

Since the table tbl_accountnumber has a relationship with the database and my retail report has relationship with certain tables but it does not have a connecting table that decides what account number to display.

I always get account number 2 displayer instead of 1 that would like to be default.

I could hard code it to the report, but don't want to do it. How do I make it display record 1?

I could create new unrelated table but then I would store my company account numbers in 2 separate places.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom