Itemized bills in Word - ms-word

I'd like to generate itemized bills for a non-profit as a Word mail merge.
Right now, the source data is stored in Excel in a pivot-table-like structure (this wasn't my idea) with two cells (owed and paid) per item type per customer. (Each customer has one row, and each item type has two columns). The existing data is in this structure, but if there's a way to automatically convert it to something better, I'm open to ideas.
I currently have a Word mail merge document generated by a Word macro that writes a Word IF field code for every pair of columns (item type). (Not all customers have all item types, so I need IF fields to exclude the ones each customer doesn't owe).
The problem is that only I know how to operate this system, and I no longer have time to generate all of the bills myself.
Ideally, I'd write my own billing app (this would also solve a number of other problems), but I don't have time for that, either.
Is there any way to (reasonably quickly) make a system to allow somewhat less technical people to do all of the billing without me?
We've looked into QuickBooks, but it cannot import the existing transactions.

Here is one solution I've thought of:
Manipulate the Excel data into a non-pivoted form with one row per transaction (per item per customer, or per pair of cells in the current structure). I actually already did this in a failed attempt to import the transactions to QuickBooks.
Each row would turn into one item in the bill (as opposed the the current, pivoted, form where each row turns into an entire page with many items)
Then, make a Word merge document that checks whether the current row is the first row for a different customer, and, if it is, include the entire text of the bill (as opposed to the items) in two (very large) IF field codes.
All of the rows would generate an item in the bill.
Each customer's last row would follow that with the second half of the text for the old customer (the part after the items).
Each customer's first row would precede it with the first half of the text for the new customer (the part before the items).
Two IFs are necessary to handle the first and last customer.
I would have to add a formula column to the spreadsheet that tells me whether to insert the prefix, the suffix, or neither, as that's impossible to do in Word. (You can't peek the next record)
The merge generator would still be a complicated monstrosity, but it would never need to change; new item types would be picked up from the source data. (Unlike the current merge generator which requires a new macro-generated field code for each new item type). Even so, I'd probably make a macro to generate it in case the texts change. (Editing texts inside field codes is very annoying).

Both Word and Excel have VBA built-in and if you use these, then you are not limited in what you can do. This type of application really should be driven from a database (Access) which would generate itemized bills, add a preamble, and a bottom total and miscellaneous after the itemization.
However, if you need to stick with the Excel data, then think of Excel as the database, write your VBA code in Excel to produce the bills, and then either assemble the word document in Excel (VBA) or place it in a worksheet format that only requires trivial work from a Word template to pull it all in.

Related

Infopath Repeating Table Replacing Looked Up Values in all Rows; Values Based on Two Seperate Fields

Here's the thought process and believe it or not I had it working and then it broke, now I am not sure why or how to fix it.
I have a secondary data source that is housed in a SharePoint list that contains billing rates for various tiers depending on the customer.
When you initially select a Tier and then the subsequent Positions under the daily billing area all is fine and dandy and values look up as they should.
However as is often the case someone will input the wrong Tier for the billing sheet and it would need to be changed to reflect the actual Tier. When this happens InfoPath is grabbing the value from the first row for the lookup and making it the value for all the position rate fields in the repeating table.
You can change them back, by selecting a different position and going back to the original position, however that is another step.
Seriously, this is the last bit for me to sort out before I can put this project behind me. I've included some screenshots of the groups and how they are laid out and the rules I have setup.
[Rules for Rate Tier field](https://i.stack.imgur.com/DO7e4.png)
[Rules for Position field](https://i.stack.imgur.com/JF8bh.png)
[Groups and Fields layout](https://i.stack.imgur.com/7etEq.png)
[Example of issue I am having](https://i.stack.imgur.com/aKD3t.gif)
I've tried everything from filtering the rate returned by the Position in the secondary source matching to the Position in the form which is activated conditionally when the Rate Tier equals a specific Tier. I've tried eval which I am not familiar with so I either got true or false but it never returned field contents.

Microsoft Access Form combo boxes and calculations

I have a question regarding a data entry form for project pricing estimates I am currently building.
To give you some context: The form will be used to enter data and complete calculations. It will replace an excel spreadsheet comprising of 59 columns, 1-15 rows (it varies by requirements) per project estimate. Average number of projects is 50-60 per year saved in respective customer folders. If there is an update to the estimate, a new version of the spreadsheet is created and saved in the respective customer folder. Hence, in certain scenarios, there are can be up to 10 versions saved per customer per project.
I am seeking to create a form-table combination for each of the customers: hence 10-15 forms with the same structure. Currently, I am only creating one form and table combination as a test. The table designed to replace the spreadsheet will use a total of 30 auto number foreign keys to store information. To be user friendly, I am using combo boxes in my form, where the user types in text but is stored as a foreign key in the table.
On top of this, I need to include calculations. For example, if the user selects certain options from my combo boxes, this will result in a calculated answer in an adjoining form field. Part of the calculated answer will use data in a linked table from another access database. Based on the options selected in the form combo boxes, the database will scan specific columns in the linked table to find matching entries to the selected combo box options. If a match exists, a price is extracted from that linked table. So say the combo box options selected are origin Miami and destination Salt Lake City, the database will scan for those 2 entries in the linked table. If that entry combination is found in the linked table, this price is to be used in the calculation. This price will then be multiplied by two other components entered by the user in the form, resulting in the calculated answer.
My questions:
Regarding the calculation example I gave above, can the above scenario be realistically accomplished in Microsoft Access? If so I am assuming I have to use VBA and/or Macros to do so?
a. If so, is it suitable to use my data entry form to complete it? Or is there an alternate way to achieve this result?
Will 30 combo boxes combined with such calculations have a significant impact on the speed of my form and database, especially as more data is added to the form and given that 10-15 forms will use the same structure? I have thus far included half of the combo boxes in 1 form, completed 1 test entry and I find that occasionally there is a slight lag when opening the form.
a. If it will impact my form's performance, what are my options/other form controls I can use to minimize lag and maximize speed?
Many thanks in advance!

Getting ID fields from the primary table into the linked table via Form

As an amateur coder for some years I have generally used sub forms when dealing with linked tables to make the transfer of ID field from primary to sub nice and simple...
However in my latest project the main form is a continuous form with a list of delivery runs (Date, RunName, RunCompleted) etc... Linked to this primary table is a delivery list containing (SKU of product, Qty etc...). I use a simple Relationship between the two tables.
Now, On the main (RUNS) form at the end of each row is a button that opens the DELIVERIES form and displays all records with matching RUNID
This is fine for displaying pre-existing data but when I want to add new records I have been using the following code attached to the OnCurrent event:
Me.RunID = DLookup("[RunID]", "tbl_BCCRuns", "RunID = " & Forms![frm_BCC_Runs_list]![RunID])
I have also used:
Forms![frm_BCC_Deliveries].Controls![RunID] = Forms![tbl_BCCRuns].Controls![RunID]
(Note: above done from memory and exact code may be incorrect but that's not the problem at hand)
Now... Both these options give me what I need however...
I find that as I am working on the database, or if you open certain forms in the right order (a bug I need to identify and fix clearly) you can open the DELIVERIES form without the filter (to view all deliveries for arguments sake) and the top entry (usually the oldest record) suddenly adopts the RUNID of the selected record back in the main form.
Now, my question is this, and the answer may be a simple "no" and that's fine, I'll move on...
Is there a better way, a way I am not familiar with or just don't know about due to my inconsistent Access progress, to transfer ID's to a form without risking contamination from improper use? Or do I just have to bite the bullet and make sure that there is just no possible way for that to happen?
In effort to alleviate the issue, I have created a Display Only form for viewing the deliveries but there are still times when I need to access the live historical data to modify other fields without wanting to modify the RUNID.
Any pointers greatly appreciated...
Since you only want to pull the RunID if the form is on a new record row, do a check to verify this is a new record.
If Me.NewRecord Then
Me.RunID = DLookup("[RunID]", "tbl_BCCRuns", "RunID = " & Forms![frm_BCC_Runs_list]![RunID])
End If
Could also consider a technique to synchronize parent and child forms when both are subforms on a main form (the main form does not have to be bound) https://www.fmsinc.com/MicrosoftAccess/Forms/Synchronize/LinkedSubforms.asp

2d form for data entry in Access

I'm using Access 2010 and I would like to create a form where useres can enter data much like they can in an Excel format. The users need to enter a date when a step is complete for a specific unit.
In Excel the units run aross the top row, the steps run down the left column. In the cell where the unit and step meet, you put a date when it is done. In Access it is much harder to create a form that looks like this (at least it has been for me so far). I tried to use a crosstab query, but you cannot enter information into a crosstab query. I can do a massive form listing every combination of units and steps, but there are over 50 units and each one has 63 steps. I don't want users to have to look through a form with over 3,000 lines in it just to enter a date completed.
This definitely feels like something we should be using a database for instead of an Excel spreadsheet. I have the format for the back end tables to hold the data. My problem is how to create a form that is easy for the user to enter the dates.
I think you have three options. First, you could build the form from scratch, which you've already admitted would suck. And it would take a lot of VBA to get the data in the right place. Second, you could automate Excel - it's the same as the first method but you don't have to build the form. You would populate an Excel spreadsheet and write the changes back to the database. This is not a trivial task and I don't recommend it.
The third option is to throw away the idea that you want to do this in a grid. You've probably been doing it in Excel and to the extent that you replicate that, your users will be happy and comfortable. Moving to a database gives you benefits, but there are costs. This is one of the costs.
So create a form with a dropdown containing all of the units. When a unit is selected, populate a subform (datasheet view) listing all of the procedures and dates. The user can then select the unit, and fill in the date next to whichever procedures he wants. Then he can select another unit and do the same thing. If you set it up right, your data will flow to the tables automatically and you'll get all the benefits of data validation, input masks, relationships, and whatever else you're using at the table level.
I know that's not what you were looking for, but I think it's the best way forward.

When a teacher add an assignment, all the student names appear. How to do it?

I have a task to create a database to track student results in a school. I came out with a set of relationships between the tables according to the 3 forms of normalisation(I hope I got it right. If not, please enlighten me).
One feature that I want to put in the Filemaker app is that when a teacher want to enter some assignment marks, he will just need to create a new submission record and all the student names in the class will appear.
I could not think how this feature can be done in Filemaker. I can only create a new submissions record and key in a student's score, then create another new record to do the same thing for a second student.
Can someone help? I am a teacher, not a Filemaker developer so please correct me if my database tables are done wrongly.
Update:
I will like the output to be like this
Spreadsheet is not suitable because it can't be used to search/sort easily.
I have a quick sample file here. It's an old sample and it uses a different (but similar) model. Basically the idea is that: You have a calculated field (I use a repeating field) to display the data. You also have a global repeating field that serves as an editing widget. Each time you go to a record you fill this field's reps with data from related records (using a OnRecordLoad trigger). This doesn't mean the field shows the same data for all records, because its conditional formatting rules are set to hide all data; so it only shows a piece of data when you actually enter one of its repetitions. This is the data that can be edited. And finally there's a trigger that fires each time you exit the field and posts your changes to the related table (adds, updates, or deletes).
The sample isn't quite complete because if there's fewer data columns than repetitions, you'd probably want to somehow lock the remaining repetitions; this part isn't done. Otherwise it works fairly well. In FM 12, however, it tends to freeze the app; I reported this to FMI, they acknowledged it, but I don't think it has been fixed already.