Updating a field in another table from my form

mbrineha

New member
Local time
, 22:20
Joined
Nov 12, 2014
Messages
5
I have built an Inventory application and have everything done except being able to update my Quantity on Hand in the Products table by subtracting the New Transaction form's Quantity Sold.

I am new to macros and using Macro Builder. I finally got the code right with the correct expression, but now I get an error saying I can't update the field because the table is Read Only (I am assuming it is referring to the Products table).

I am calling the macro from the After Update property on the form.

I have tried several approaches, but none of them have worked. Any ideas?

Thanks!

Mel
 
Ypu can do this very easily with DAO or ADO VBA code in a subroutine or function. It's much more powerful than using a macro. Marcos are difficult to debug and single step through; plus it is hard to drill down into macros. Either way, you have a big learning curve. Years ago, I bought an O'Reilly book, Access Databases, 3rd Edition (as I recall), which is an excellent hornbook on databases and DAO and ADO coding. It's probably very cheap as a used book on Amazon.com and well worth having as a reference book.
 
Thanks so much for the reference to O'Reilly. I am heading over to the library to get a copy now!

Yes, I do have a huge learning curve and very little people at my university that knows anything about programming with Access. I have 2 weeks to figure out this last 'little' stumbling block before I have to present on Dec. 2. Wish me luck!

Thanks again,

Melissa
 
Hi,
I think I can help you out, can you give me some more detail on the table structure, and what you are trying to do.

Thanks
 
Hi,

Thank you for your response.

My application is a simple inventory control design. I have a company, customer, vendor, product and transaction tables (the main ones, I have a few look-up tables, too).

They are all connected via primary auto-number Ids.

Everything works nicely, too, but I want my Transaction form to update the Quantity On Hand in my Products table (for New Transactions only) from the Quantity Sold entered on the Transaction Entry Form.

 

Users who are viewing this thread

Back
Top Bottom