home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Update Query in MS Access 2000

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1583
Discussions: 200,925, Posts: 2,379,128, Members: 246,291
Old February 26th, 2002, 05:31 PM   Digg it!   #1 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: New Hampshire, USA
Posts: 641
Update Query in MS Access 2000

I have been told to write an update query on the face of a data entry form to convert pounds to feet.

I know how to run all the ODBC calls to pull part numbers, units of measure and then run a test to determine whether a data conversion should occur, then how to make the conversion happen.

My problem is in making this query update update a field on the face of the form rather than a table field.

Has anyone else done this type of operation before?
ctaylor is offline   Reply With Quote
Old February 26th, 2002, 06:08 PM     #2 (permalink)
Thaumaturge Member
 
howste's Avatar
 
Join Date: Oct 2001
Location: West Haven, Utah
Posts: 15,310
AFAIK you can only update the table field. Maybe you can run the update query, then refresh the data displayed in the form.
howste is offline   Reply With Quote
Old February 26th, 2002, 10:01 PM     #3 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
howste.

I know what a 'Thaumaturge' actually is...

Quote:
form to convert pounds to feet.

Anyway, one cannot accomplish this, as pounds is a measure of weight/force+dir and feet is distance, thus apples and foul tasting limes.

Now you have a form you display to the user. You can do this client or server side, YOU choose
User enters in pounds into pounds field and then does what? Click submit.
Submit should send form to be processes somehow, either by client side processing (javascript/...) or by server side.

Iffin client side, jabbascript function will be able to access and set any form fields.

Iffin server side, send back form with pertinent information all filled out.
qball is offline   Reply With Quote
Old February 27th, 2002, 02:18 AM     #4 (permalink)
Thaumaturge Member
 
howste's Avatar
 
Join Date: Oct 2001
Location: West Haven, Utah
Posts: 15,310
LOL, if he knows how to convert pounds to feet, then let him do it! The other part should be relatively easy in comparison.

This code should do what I suggested above:

DoCmd.OpenQuery "UpdateQueryName"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

If you don't want it to update the table immediately, you could update the value in a dummy table until you're ready to update the real table. Hmmm, did that make sense???
howste is offline   Reply With Quote
Old February 27th, 2002, 09:58 AM     #5 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: New Hampshire, USA
Posts: 641
Thanks for your help guys.

I will give this a shot and let you know how this works.

Concerning the "pounds to feet" conversion what I need to do is convert the number of scrap pounds from a production run into the equivalent amount of feet of heat shrink tubing that could have been extruded.

Without getting into all the details I can convey that the database does the following:
1 - ERP sales order numbers are tied to product
2 - Engineering resources are called to determine product subcomponents and formulas to calculate ratios
3 - subcomponents are further broken down into subcomponents and the same calculations are created and applied to the higher level subcomponents calculated values
4 - material costing information is interpolated from ERP records from purchasing
5 - variances and margins are calculated against standard costing information generated in
6 - the database also makes calls against payroll to calculate the overhead and direct labor components for each of the subassemblies before tallying it all together with the cost of producing the final product for actual total costing considerations

As you can guess, it took me a while to get this whole thing written and it works great because the data entry person only has about 5 data fields to enter in order to generate all these calculations. Unfortunately the unit comparison for heat shrink tubing fails as standard costing is calculated in feet produced, not pounds consumed.

I want to "massage the data" so that when a sales order calls for a heat shrink product, that the amount of scrap pounds produced can be converted to an equivalent amount of tubing. My thought is that I could perform an "on exit" event on txtScrapLbs to test the text box bound to the sales order to a heat shrink pruduct and if this tests true, perform the conversion of pounds to feet before writting it to the main data entry table. If the test proves false, then the user data is written directly to the table without conversion.


Come to think of it. I should probably declare a variable in the form module, set the current value of that variable to be equal to the user entered value of txtScrapLbs. From there I can actually run calculations and assign that variable's value back to the text box bound to scrap pounds. This way I may be able to avoid the whole "update query" approach which is not working for me........I will let you know what I come up with.

Last edited by ctaylor : February 27th, 2002 at 01:08 PM.
ctaylor is offline   Reply With Quote
Old February 27th, 2002, 10:16 AM     #6 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: New Hampshire, USA
Posts: 641
Thanks for the dummy table suggestion too - I already have a report extract table to speed calculations for report generation.
I had not considered binding the data form to a temp table and then updating the main data table. My initial thought was to try and keep this as simple as possible which is why my first thought was for the form test and conversion solution.
ctaylor is offline   Reply With Quote
Old February 27th, 2002, 12:53 PM     #7 (permalink)
Thaumaturge Member
 
howste's Avatar
 
Join Date: Oct 2001
Location: West Haven, Utah
Posts: 15,310
Pounds to feet didn't seem that odd to me because I have done similar calculations converting linear feet of wire mesh of different widths to pounds of wire to manufacture it. It sounds like you've got it under control.
howste is offline   Reply With Quote
Old February 27th, 2002, 03:45 PM     #8 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: New Hampshire, USA
Posts: 641
OK, I am able to get the record written to a temporary table, then run queries to test and convert the data.

I think I'm stuck though in that I also want to require the sales order number to be unique. Any ideas on how to ensure that the sales order (drawn from a combo box bound to our ERP system) and written to the temp table does not allow for a duplicate sales order entry to be appended into the live data table.

Is there a way to draw data from one table and index it against another table to ensure a unique record is written to a 3rd table?
ctaylor is offline   Reply With Quote
Old February 27th, 2002, 04:23 PM     #9 (permalink)
Thaumaturge Member
 
howste's Avatar
 
Join Date: Oct 2001
Location: West Haven, Utah
Posts: 15,310
I'm guessing that the live data table isn't an Access table. If it was, you could just set the property in the table to not allow duplicates in that field.

It might not be the best way, but you could pull all of the ERP sales order numbers into an Access table with no duplicates allowed, then try to append the new sales order number. If it gives you an error, don't append it to the live data table.

Or maybe instead of having the combo box based on the ERP data, have it based on a lookup query that excludes all sales orders that exist in both ERP and the live data table. (I hope I understand correctly the way your tables are related)
howste is offline   Reply With Quote
Old February 27th, 2002, 10:17 PM     #10 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
Quote:
one cannot accomplish this

Well iffin it's pounds of raw mat to feet of finished product...DOH!

Quote:
...does not allow for a duplicate sales order entry to be appended into the live data table...

What is the PK of the 'live data table'?, sounds like it should include 'sales order number'...
qball is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2865)
Obama the Muslim (14)
Is the PSU I received dead? (10)
windows vista security holes (9)
Foreign voltage (10)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (10)
Print spooler problem (13)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
Ideal cheap graph card for PC-Gamin.. (15)
New Computer wont recognize XP disc (7)
EVGA 9800 gtx help with finding a g.. (8)
World's largest Monopoly Game using.. (331)
Recent Discussions
Modern Warfare For the PC (33)
radeon x850xt platinum & shader 3 (3)
Have you switched yet? (84)
Install XP pro and a Vista laptop ?? (10)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
Fire in DVD (0)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
monitor will not turn on at all, (1)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
EVGA 9800 gtx help with finding a goo.. (8)
Problem with speed step/turbo boost? (1)
Modern Warfare 2: Who Bought It? (61)
SIS 740 and Widescreen (8)


All times are GMT -4. The time now is 01:02 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28