Having trouble

Gemini32

Board Regular
Joined
Feb 9, 2003
Messages
51
Hi Folks


Its been a few weeks now and I've been pluging away at using the UPDATE QUERY ...I've accomplished in getting the information I want to update in the update query ...I've even design a form from my original query and made a command button to use the update query ....

My question is how can I get the information in the form when filled out completely and I click on the update button at the bottom of the form that it updates the columns that are specfied in the update query
and refreshes so that when I re-enter a different amount in the unit price column that it takes the new amount and refigures the calculation that I want it to do...

So the steps I want to be able to do are:

1. Fill out my form and once it's completely filled out then...

2. Click on the command button I designed for updating automatically
(for the unit price column)

What Step 2 does is it will multiply 25% to the amount typed in the unit price column then...

3. To delete the figures in the update query and finally

3. Enter new amount in the unit price column when filling out a new work order form

I would like this to happen every time I fill out a new work order

This board is absolutely, positively, marvolaous, and the members are awesome....So if anyone can help me it would definitely be very much appreciated..... I'm so close to being where I want my mdb to be that it really hurts to be that close but not function completely right..........


Gemini32
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi Gemini,

Sounds like a combination of two problems. One, you need to requery whatever is housing the data you need to update,and two, the form is 'dirty', you need to commit the changes. If it is a listbox, for example, you'll need to do something like,
assume your inputing data into textbox1

Textbox1 Afterupdate()

If Me.Dirty = True then Me.Dirty = False
Forms.YourForm.YourControl.requery

end sub

That should keep everything fresh. If you need to requery more frequently, instead of attaching this code to every textbox into which you could put data, you can have the form change() event trigger it, which would capture any change to any field in the form.

HTH,
 
Upvote 0
Requery makes sure that an object linked to a table or query is displaying the current data in that query/table. Say you make a choice on one combobox that affects a query which populates a listbox. You now have two problems,
1. Your form is dirty, in that you are 'between fields' and the record isn't commited until you've gone through all the fields, or told it explicitly to save.
2. The listbox is displaying what was in the query when you opened the form. Now the query has a new dynaset, and you want your listbox to reflect this updated data.

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,497
Messages
6,160,151
Members
451,625
Latest member
sukhman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top