Using "Add Record" button (1 Viewer)

staylor

Sapling amongst trees
Local time
Today, 15:28
Joined
Jul 3, 2008
Messages
20
Hi All,

I'm new to database construction and have a question about the "Add Record" button. How can I make this button add selected data from a form to a table.

I have already built the form, but i need to print a record of the data it calculates.

Do I add code to the macron of the button, or do i add code to the data fields in the form.

Thanks
 
The add record button usually means bring up a blank form for data input.
Typically when you move off the record, close the form, etc. it then saves the data.
 
I'll try to explain what i'm wanting to do better.

On my form, the user will select data from two combo boxes then input data in two text boxes. A calcuation will happen in the background afterwards displaying the quantity. If the data is what the user wants, i want them to click a button to save the data from the combo boxes, text boxes, quantity and some hidden values to a (form,table,record), then change selections and inputs to produce a different quantity, save....etc. Finally printing the saved data when they are finished.

Can I do this with a button to add and save the data, or is to complex to do this way?
 
Ok, is each set of entered data unique or rephrased, saved in it's own record?
The binding (bound form) of the fields to the underlaying table causes Acces to save new data, or update existing data. If you are using an unbound form (fields not tied to anything) than that is a whole nother ball game. Learn VBA to do that easily. Buttons only initiate an event, it's up to you to tell what to do when that event is initiated.
 
Yes, each set of data will be unique, and will need to be saved as it's own record. But I do not want this data to be stored automaticly after the calculation happens. I want the user to be able to change input values or selections to satisfy their needs. Therfor i will need them to trigger the save event. Only thing I could think of is a button.

I guess I want to know if I will need to put code in the Button to save the fields when "clicked" or put the code in the fields I want saved to save when the button is clicked. Perhaps i will need code in both?

I'm a newbie at this so bare with me. The boss throws this on me cause i'm a "computer guy"...lol. Last time I did any coding was FORTRAN class.....lol
 
If you bind the fields to the table behind the form, access will update/add automagically.
So if you want the users to control the update, then you need an unbound form. How ever this creates problems because it takes a lot of coding to get that right. You may want to rethink your strategy at this point. If you doubt that, read my first sentence above again. What I think you are asking, can be done, but not easily because it goes against the basic design of how Access works.
 
I was thinking that i was making this more complex than I needed.

So basiclly, I need to create the table, then make the form bound to the table with the add record button.

This I'll probably start the DB over again(Rev3). LOL, they keep adding more things they want to do as I'm building which brings me to points like this.

Thanks for all your help.
 

Users who are viewing this thread

Back
Top Bottom