Re: How does autofilled form fields info end up in table fields?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 01/20/05


Date: Fri, 21 Jan 2005 00:44:38 +0800

In general, you don't want the same information stored in multiple tables.
With your example, the product price is likely to change, and so it makes
sense to use the AfterUpdate event procedure of the ProductID combo to
lookup the current price and offer it as the default price for a new order.
You can see how Northwind does this - using DLookup() - if you open the
Orders Subform in design view, and examine the AfterUpdate event of the
combo.

Store the product description also? Hmm, might be needed if you really want
the flexibility to call a spade something else. But the unit of measure
probably should not change, unless you are working across different
countries that use different measurements. The cases where you want to store
the same information in different tables are very limited.

In any case, the AfterUpdate event of the combo is where you assign the
value to the text box bound to the other fields.

Is that what you were asking?

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"rich1838" <rich1838@discussions.microsoft.com> wrote in message
news:D4C01ECE-9309-4432-B533-869D160374CE@microsoft.com...
>I guess my explanations have unfortunately brought us down the wrong path. 
>I
> already knew what info was in multiple columns of the combo box. After
> selected, Column 1 info (primary Key Hidden) appears in the combo box and 
> is
> stored in all related tables. The subsequent text boxes on the form which 
> are
> related to the combo box automatically fill with the correct data. This
> related dated, however, doesn't "cascade" into any of the tables. I also 
> have
> trouble with cascading the date. If it is manually typed into a field on a
> "Table" then it cascades, yet autodate (=Date() ) or manually typing in 
> the
> form will not cascade the information into any of the tables. I guess to
> compare, hopefully this will clarify, if you look at the preloaded 
> template
> for order entries and select a product, the unit price automatically 
> enters
> into the field from the product table. this value is found in the 
> approriate
> Unit Price field on all tables, datasheets, subdatasheets, forms,
> reports,etc. I have expanded this concept from scratch to include item
> descriptions, unit of measure and varied pricing. my product ID appears in
> all related fields, but the related information does not? It only appears 
> in
> the form and subform created.
>
> "Allen Browne" wrote:
>
>> Combo boxes in Access can display multiple columns when dropped down. The
>> Column Count property indicates how many columns it should display.
>>
>> They have a Bound Column property which tells which of the columns is
>> actually the stored value. Typically it's the first column (i.e. the
>> BoundColumn property is 1).
>>
>> They also have a Column Widths property which specifies how wide each 
>> column
>> should be displayed. If this property is set to:
>>     0"; 1"
>> then the first column is not displayed because it is zero-width. Instead,
>> Access shows what is in the 2nd column. Access is not *storing* one 
>> thing,
>> but *displaying* something different.
>>
>> To see what is being stored there:
>> 1. Open your table in design view.
>> 2. Select the lookup field.
>> 3. In the lower pane, click on the Display Control tab.
>> 4. Change the Column Widths so the Bound Column is not zero-width, e.g.:
>>         0.5"; 1"
>>
>> Once you can see what data is actually in the field, you can then begin 
>> to
>> figure out how to set the criteria in your query to match it.
>>
>> -- 
>> Allen Browne - Microsoft MVP.  Perth, Western Australia.
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>> "rich1838" <rich1838@discussions.microsoft.com> wrote in message
>> news:8F344E0A-90AA-409A-BC9E-EFC150B4416D@microsoft.com...
>> > OK, I did use the lookup wizard for these fields and I read the pages 
>> > you
>> > sent. I am still confused. In order to create a form where you use a 
>> > combo
>> > box to find information, it is selected, and the following related text
>> > boxes
>> > automatically reveal the related information, I have created a 
>> > multi-table
>> > query and used form wizard, selecting various fields and tables and had 
>> > a
>> > subdatasheet/form created. Only info physically typed in (=Date() 
>> > didn't
>> > put
>> > the info in the date field on the table) or clicked from the combo 
>> > boxes
>> > is
>> > placed in the tables. I can't figure how the form will automatically 
>> > enter
>> > the appropriate information, yet it won't automatically enter into the
>> > corresponding table fields. I even tried datasheet style form, the 
>> > fields
>> > on
>> > the datasheet form work, but again going to Tables and looking at the
>> > datasheet view there is no info in the same fields. Maybe it isme but 
>> > this
>> > makes no sense?
>> >
>> > "Allen Browne" wrote:
>> >
>> >> You used the Lookup Wizard in your table for these fields? It does a
>> >> great
>> >> job of messing things up, so that what you see is not what you get.
>> >> Details:
>> >>     http://www.mvps.org/access/lookupfields.htm
>> >>
>> >> The solution for your report is to include the lookup tables in the
>> >> query,
>> >> or else provide criteria based on the stored value (which you probably
>> >> can't
>> >> see.)
>> >>
>> >> If you include the lookup tables in your query, and some of the 
>> >> records
>> >> have
>> >> no entry in that field, you need to use outer joins so as to get all
>> >> records. Details:
>> >>     http://members.iinet.net.au/~allenbrowne/casu-02.html
>> >>
>> >>
>> >> "rich1838" <rich1838@discussions.microsoft.com> wrote in message
>> >> news:BDB6581E-0662-4F48-A900-468BCA89FCE3@microsoft.com...
>> >> >I created a databes which basically is an expansion or the template
>> >> >Order
>> >> > Entry from scratch. All of the relationships are ok, the forms are
>> >> > working, I
>> >> > enter data from combo boxes and the following related fields
>> >> > automatically
>> >> > display the appropriate info. However when I review the datasheets 
>> >> > and
>> >> > subsheets in tables, the information is not in the fields. I also 
>> >> > can't
>> >> > get
>> >> > the info to print in a report. Is there an expression to get this 
>> >> > info
>> >> > to
>> >> > appear in the datasheets and where would I put it? 


Relevant Pages

  • Re: DLookup Help Needed
    ... If you go into the table and try to add a column, there is Insert, Lookup ... but are NOT great ways to display it ... ... I am trying to look up the Price, in the Chemicals table, based on the ...
    (microsoft.public.access.gettingstarted)
  • Re: Follow up - Rockler in NJ at Force Machinery
    ... huge display of Amana router bits with drawers below so they must ... From what I looked at as far as price ... stores in the middle island. ... wings, but it's very solid. ...
    (rec.woodworking)
  • Re: ADVICE please.. toshiba satellite a30
    ... I don't think it's a great bargain, but it's an "ok" price. ... Display: Tech XGA TFT LCD ... Installed RAM: 256 MB ... Installed Cache Memory: 128 KB ...
    (comp.sys.laptops)
  • Re: Peremanently removing decimal places
    ... Dim cellRange As Range ... So if that value is the price for one widget, and in cell C1 I multiply ... not just to display 2 decimal places. ... If it's .oo then format as a number with 2 decimal places. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Too Dark?
    ... Those big screen flat panels are too expensive and scarce. ... However I would hardly call 50" plasmas scarce - Best Buy, Circuit City, and the like all have 50" plasmas on display. ... I should also point out that the current on-line price for the 50" Panasonic commercial model, the TH-50PHD7UY, is around $3800 from the reputable dealers. ... So if you can live with the plasma as a monitor - no tuners, no speakers, limited number of connections although it does have interchangeable slots, you can get a good quality 50" plasma for less than $5K. ...
    (alt.tv.tech.hdtv)