How would you go about saving the information in a MSHFlexGrid(used as an invoice) to a database so it can be recalled later?
Every day above ground is a GOOD DAY!!!
In my opinion, and in order to avoid redondant data (data mentioned several times in a same table) you should use two different Access tables called f.i. INVOICE_HEADERS (containing all information about the customer's id., date of the invoice and all other unique fields on the invoice) and INVOICE_ITEMS (containing all the fields such as item #, quantity, unit price and all other fields occuring more than once on the invoice).
Then make a one-to-multiple relation between them with a common field (f.i. Invoice_Nr in both tables).
When clicking the button control on the screen to save the grid data, first add programmatically a new record to the table INVOICE_HEADERS, then fill in the fields of that record.
Afterwards, make a new record in the table INVOICE_ITEMS, fill in the fields. Loop through the entire grid down to the bottom, and repeat for each record (add new record and fill in the fields).
When viewing an existing invoice, make a query in Access, make a report based onto this query, and call the OpenReport statement in your code passing a parameter (Invoice_Nr).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.