PC Review


Reply
Thread Tools Rate Thread

creating an SQL to display cost and material want to type material

 
 
=?Utf-8?B?YmFicw==?=
Guest
Posts: n/a
 
      5th Sep 2007
I have the following code in the afterupdate event of a field called actual
Pit. Once the pit is selected it shows only the cost and material from that
given pit.

Private Sub cboactpit_AfterUpdate()
Dim nsql As String
nsql = "Select Costperton,Material " & "FROM materialcostsheet " & "WHERE
pit=""" & Me.cboactpit & """ " & "ORDER BY material"
Me.cbocost.RowSource = nsql

End Sub

However - it functions and looks nice but not doing Exactly what I want it
to do


It display the costperton, than the material in the drop down obviously in
order by material

Don't know if this is possible but I would like the user to type in the
material Name and it to scroll to the given material - BUT THE COSTPERTON
SHOULD BE STORED IN THE FIELD - One is text the other number field not sure
what i need to do or if this is possible.

Thanks,
Barb
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      5th Sep 2007
On Tue, 4 Sep 2007 18:52:03 -0700, babs <(E-Mail Removed)>
wrote:

> BUT THE COSTPERTON
>SHOULD BE STORED IN THE FIELD


No, it shouldn't.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.

John W. Vinson [MVP]
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bill of material type query DKS Microsoft Access Queries 3 8th Oct 2009 11:46 PM
Creating lookup formulas for material cost spreadsheet =?Utf-8?B?bW5fdGF0ZXI=?= Microsoft Excel Worksheet Functions 5 15th Dec 2005 09:46 PM
making one material list from mulitple vendor material lists =?Utf-8?B?SW4gdGhlIGJlZ2lubmluZw==?= Microsoft Excel Worksheet Functions 1 8th Jan 2005 02:49 AM
Display material with usage =?Utf-8?B?bGludGFu?= Microsoft Excel Worksheet Functions 4 25th Nov 2004 08:32 AM
Creating Table from Web-Based Material Ken Microsoft Excel Programming 2 22nd Jan 2004 07:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:41 PM.