Problem updatin record

D

Damian Vila

Please, I need help with the following problem:
I have a system to track orders and invoices. Both are
related but may be used independently: an order may have
an invoce, and an invoice may, or may not, have a previous
order. I have three tables for this: a table for orders, a
table for invoices and a table for order/invoice details
(with a one to many relation in both cases). This table
has a field for the order ID and a field for the invoice
ID. My problem is that I need users to select an order
from a list in a form and then, at the press of a button,
populate the invoice table with the order data (this is
already done), get the new invoice ID (don't know how to
do it) and update the details proper records with the
invoice number (all in the same 'click' event), and then
open another form with the new invoice filtered and a
subform with the details (this is also done). I've tried
executing a SQL statement to retrieve the invoice ID, but
it doesn't let me do a SELECT statement to recover it.
I've tried calling a query, but don't know how to pass it
the search parameter to get the proper ID. I've tried
updating the table during the 'open' event on the invoice
form I open afterwards, but the table is already locked...
Can anyone suggest me a solution?. An example would be
very appreciated, since I'm not proficient in VBA.
Thanks in advance,

Damian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top