outofpractice
Registered User.
- Local time
- Yesterday, 17:49
- Joined
- May 10, 2011
- Messages
- 32
A coworker has a set of test files (txt format) which they use consistently - sometimes the test region they are using changes so they have to open up each file and change a small portion of it to point to the new test region. (There will be other changes done as well sometimes, or additions/deletion of these tests). So to try and help her with this I've made a database which does the following, but I know it is not the right way or very efficient:
There are 3 tables:
Part1 -> This has a memo field with just text, it is always the exact same information
Part2 -> This is the one that changes for the test system. It has 5 records which are strings of data that will point the test file to the appropriate test region.
Part3 -> This is another memo field which is the actual test data. Currently there are 40 records on this table
So what I have done as of right now is: Created 40 reports - one for each separate "Part3" row - I have a macro that will run each report and then export to a location as a txt file. This is inelegant, but it works.
The problem - something I did not take into consideration was for Part1 -> there will actually be two options there (Two independent test system) and each of these options can go to one of 5 test regions. Each of the test systems will have their own set of test data contained in Part3 of the report. So, to continue with how I am doing this I would then continue to duplicate the reports, so now I am up to at least 80 reports
I could continue with what I'm doing, or just copy the database and have one for each test system - but I am sure there has to be a way to only have one report and have it reference the correct information.
What I have in mind and am asking for help is:
Have a form where there user selects: Test System (Part1), and Test Region (Part2) -> A query would use this information to determine the appropriate information for the Part3 data and each report would be dynamically built and exported based on the number of rows for a particular Test System at that time.
If I could do this it would eliminate any maintenance I need to do when a new test for Part3 is added (which my current way I would have to make a new report and add it to the export macro).
The current structure I have in place now for the tables are:
tbl_Part1:
Part1_Text -> the text that is exported in the file
System -> added this part this morning to identify which Test System the text is affiliated with
tbl_Part2:
Part2_Text -> the text that is exported in the file
TestSystem -> identifies which text is needed to be sent in the file
tbl_Part3:
Part3_Text -> the text that is exported in the file
TestID -> just a field to help the user know which test she is looking at/can search by if there is an update needed to one or if one is deleted - i.e. she could tell me she is deleting "Test7" so I can delete that report and remove it from the macro
NEEDED? -> Test system field to know which test system (Part1) the text is affiliated with
The 40 reports I have are all the same, only referencing the three different parts:
Part1 -> =DLookUp("Part1_Text","tbl_Part1")
Part2 -> =DLookUp("Part2_Text","TestSystem")
Part3 -> =DLookUp("[Part3_Text]","tbl_Part3","[TestID] = 'Test1' ")
I think what I need to do is write some VB that will: Loop through Part3 to build export a report - use the "TestID" from Part3 as the file name in the export so I don't hand key each one. My VB is very rusty though so I'm having a hard time getting started on this.
This is really long, so I hope my explanation of what I have am am trying to do makes sense. Thanks!
There are 3 tables:
Part1 -> This has a memo field with just text, it is always the exact same information
Part2 -> This is the one that changes for the test system. It has 5 records which are strings of data that will point the test file to the appropriate test region.
Part3 -> This is another memo field which is the actual test data. Currently there are 40 records on this table
So what I have done as of right now is: Created 40 reports - one for each separate "Part3" row - I have a macro that will run each report and then export to a location as a txt file. This is inelegant, but it works.
The problem - something I did not take into consideration was for Part1 -> there will actually be two options there (Two independent test system) and each of these options can go to one of 5 test regions. Each of the test systems will have their own set of test data contained in Part3 of the report. So, to continue with how I am doing this I would then continue to duplicate the reports, so now I am up to at least 80 reports
I could continue with what I'm doing, or just copy the database and have one for each test system - but I am sure there has to be a way to only have one report and have it reference the correct information.
What I have in mind and am asking for help is:
Have a form where there user selects: Test System (Part1), and Test Region (Part2) -> A query would use this information to determine the appropriate information for the Part3 data and each report would be dynamically built and exported based on the number of rows for a particular Test System at that time.
If I could do this it would eliminate any maintenance I need to do when a new test for Part3 is added (which my current way I would have to make a new report and add it to the export macro).
The current structure I have in place now for the tables are:
tbl_Part1:
Part1_Text -> the text that is exported in the file
System -> added this part this morning to identify which Test System the text is affiliated with
tbl_Part2:
Part2_Text -> the text that is exported in the file
TestSystem -> identifies which text is needed to be sent in the file
tbl_Part3:
Part3_Text -> the text that is exported in the file
TestID -> just a field to help the user know which test she is looking at/can search by if there is an update needed to one or if one is deleted - i.e. she could tell me she is deleting "Test7" so I can delete that report and remove it from the macro
NEEDED? -> Test system field to know which test system (Part1) the text is affiliated with
The 40 reports I have are all the same, only referencing the three different parts:
Part1 -> =DLookUp("Part1_Text","tbl_Part1")
Part2 -> =DLookUp("Part2_Text","TestSystem")
Part3 -> =DLookUp("[Part3_Text]","tbl_Part3","[TestID] = 'Test1' ")
I think what I need to do is write some VB that will: Loop through Part3 to build export a report - use the "TestID" from Part3 as the file name in the export so I don't hand key each one. My VB is very rusty though so I'm having a hard time getting started on this.
This is really long, so I hope my explanation of what I have am am trying to do makes sense. Thanks!