Writing to another table

Steve25

Registered User.
Local time
Today, 18:32
Joined
Nov 17, 2006
Messages
13
Hi,

I am fairly new to msaccess programming and am trying to build a stock control system for my business.

I am happy with everything I have done so far but there is one thing I cannot figure out.

I have set up so that the user can click a button and remove the relevant number from the stock level. The buttons are for removing 1, 5, 10 or 20 (there are reasons for these numbers). However I would also like the button to take information from the form (which is referenced to a query) and write that information, along with an autogenerated id number and the current date/time to another table. This is for our record keeping, so that we can record what is selling well etc and when the last one was sold.

How do I do this?

I have gone through the help files and my books, but I think the problem is I don't know where to start looking.

I also want to add a button that will add items to an order table. Again by taking the information from the form and writing it to another table. With this one a message will appear asking for the quantity to be entered. It will also check the order table to see if the item is already there and advise if it is.

Any help gratefully received.

Steve:confused:
 
Any ideas on this one yet as I am really struggling with this.

Thanks in advance.

Steve
 
You will need to open up a recordset based on the table you want to add records to and use the addnew method to add your record.
 
When you have the answer let me know - same problem
I am using an append qry which is not ideal, diffrent business -I need to move info from 1 table to another

I started this by saying

TableA
Refno(quoteno for me)
Name
add1
Add2
Add3
lots of other fields
and I want to copy to TableB(history)
quoteno
name
add1
add2
add3
lots o other fields

On my table A I have it doing all the calculating positive figures and negative figures I just need to be able to copy fields from A to B (append qry sometimes does not work )

I am useless at VB coding - can hack it around but not start it off

if some one could write the code to do the coding above I sure that this would be the answer to both our problems

regards
gbp
 

Users who are viewing this thread

Back
Top Bottom