Button which updates data in table!!

catcoota

Registered User.
Local time
Today, 13:43
Joined
Aug 22, 2003
Messages
30
Hi everyone
I have a form which has a button called (Update)
When I click on it, it is supposed to update fields into a table...how can i do this?

any help is appreciated !
 
More information...

Update what?
What sort of controls are you using?
Are you using DAO? ADO?
Are you just wanting to change values on a form?
Are you wanting to change a set of information within the table at one time? (Update Query)

etc, etc,
 
Hi

Well, let me explain everything 2 u

Update what?
I have a query which does a calculation and then updates the data into a table. when i run the query it asks 4 qty_ordered and ProductID and then it does calculation and then update the new value into the table. but this does not seem to be user friendly, that is why i created a form which is supposed to have a list box of product Id and I enter qty_ordered and then I click on Order button and then it does all this calculation that is done in the update query. I tried to copy the SQL code written in the update query and pasted it into the On_click event of the Order button, but it does not work

the tables I have are product, orders


What sort of controls are you using?
hmmm, I don't understand ur question

Are you using DAO? ADO?
nope, I actually don't know what it is & how to use it!

Are you just wanting to change values on a form?
No, I also wants it to change values into the table, I know how to do it using query but donno how to do it using a form !

Are you wanting to change a set of information within the table at one time? (Update Query)
Hmmm, yes, that would be better coz i might order more than one product.


Thaaaaaaaanks 4 any help :)
 
On the click event of your button, open the Code Builder and put the line:

Code:
With DoCmd
    .SetWarnings False
    .OpenQuery "qryYourQuery"
    .SetWarnings True
End With
MsgBox "Update performed."


where qryYourQuery is replaced with the name of your update query.
 
WOW Great!

Thanks dear

That looks much better !

But just one more question
Can I do the calculation without using the query? I mean can i write the sql code that does the update of data using the form code builder????
Thanks a loooot 4 ur help :D
 

Users who are viewing this thread

Back
Top Bottom