I've been working on an Invoice Creator through a system of userforms so that we can create invoices, store them into a
database and then view customer accounts to see what invoices have been settled.
So when you click on View an
Account, you select a customer from the dropdown list.
This puts the relevant CustomerID into the cell, "Search_CustID" (E12) on the setup page.
Then when you
click the "View account" button it brings up the ShowAccount userform.
I've got a multipage element in
there and it first loads up on the Customer details tab and has all their details. There's also a page "Total Invoices
(Num)" where Num shows the total number of invoices. This works by searching the InvoiceDB sheet for all invoices from
the CustomerID and pasting them into the temporary spreadsheet "InvoiceSearch" and then doing a number of rows
count to get the results. The same is then repeated for the tab "Outstanding Invoices" which are basically,
invoices that have not been settled yet. So it uses "InvoiceSearch" and searches for any that are listed under PAID
as "NO" and copies them to this sheet and displays the number of results.
If you click onto "Total
Invoices (Num)" there is a list box which links back to the InvoiceSearch sheet. It puts all the reference numbers in
the list box and when you click on the reference number, it populates the other fields so you can get the details on the
If you click onto the "Outstanding Invoices (Num)", there is a similar set up, but it shows the
total amount of money outstanding over all the invoices. If there are none outstanding, there will be none to choose.
This works perfectly... when there is a mixture of outstanding and paid invoices (try clicking on the account for Stifford
Clays and you will see it working fine).
If all invoices are paid, for some reason, in the total invoices multipage, there are no results to choose from, from the
listbox, even though when you click on the InvoiceSearch spreadsheet, there are results. You can see this if you try the
acocunt for Ramsden Hall or Millhouse School.
It has to be something to do with my coding but I'm pulling my hair
out over this... so I'd appreciate if someone could help me, thank you sooooo much.