I'm trying to change the value of a field in one of my orders to zero when i click on a YES/NO field.
It's a quotation database (still working on it :-( ) and when i click on the YES/NO field I would like the List_Price to change to 0.
It works with the query below, which I run through a macro. In orer to get it to work I have had to write the current order (Ref_ID) and the current part i want changing to zero to a text box on the main form. I then reference them in the query.
Is there a more simplier way of updating the field in VBA because it seems very long winded?
When I run the query it also says the data has been changed by another user. Do you want to copy/keep or discard the data. Is there a way of stoppping this message?
UPDATE tbl_Orders SET tbl_Orders.List_Price = 0
WHERE (((tbl_Orders.fkeyPSA_ID)=[Forms]![Main]![Ref_ID]) AND ((tbl_Orders.AutoNumber)=[Forms]![Main]![current_part]));
Your error probably occurs because you're changing a value with code that the form is also bound to. Generally you either want to use code to update data in a table or a bound form, but not both. The "other user" in your case is the bound form. Why not just change the value on the bound form?
God dame....How stupid am I?? It's a good job it's nearly the week end or I might go and hang myself. I've really should leave this database stuff to the experts. Needless to say Me.List_Price = 0 worked a treat