Run update query from subform control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field called “MarkUp†which has a default value of 1.25. It exists
in each record of table “ItemDetailâ€. I would like to give users the ability
to change this value in a set of records from a subform. I envision a
control on a subform where they could enter a value, for example: 1.21, and
then click a command button which would run an update query and change the
value in each record. I need it to update only the records related to the
record selected in the mainform.

How do I accomplish this? Thanks in advance for any help! I hope this is
explained in enough detail.
 
not easily explained via this forum; part of it is process.....

first you need to develop & run that update query - just as a sanity check
that it is do-able just using the basic query design......don't worry about
the form/subform at the moment....just enter your query criteria with the
test numbers to double check that it will do what you want it to do....

once that is working satisfactorily then you need to:
stop entering data directly into the query criteria and instead put in
references to the text boxes in the form/subform where the data will be found
i.e. Forms![FormName].[TextBoxName] should be put in the criteria area of
the query design where you were before putting in actual numbers

be sure to test this by first putting in the data on the form/subform and
then shrinking it and running the query to see if it works....remember to
move the cursor out of the textbox before shrinking so the data is really
there....

finally: put a button on the form/subform that triggers the query
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top