Re: Using a ComboBox selection to fill in other fields in form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



See if this article helps:
http://www.mvps.org/access/forms/frm0058.htm
--

Ken Snell
<MS ACCESS MVP>



"PaulHilgeman" <pkhilgeman@xxxxxxxxxx> wrote in message
news:1137037979.932183.119990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I know that I asked this question about two weeks ago, but I have now
> finished all of the other items that I was working on in my database
> and now I need to fix this one.
>
> Things have changed a bit and I have studied the northwind.mdb file
> quite a bit.
>
> However, due to the way that I need to import data, I can not structure
> my database that exact same way. In my main data table that contains
> all of the jobs, each job must have the explicit data from all of it's
> line items. I can not use the linked OrderID like they did in
> Northwind.
>
> So, I will be very explicit here in spelling it out to gain the most
> clarity.
>
> I have two tables. One is very very large. Each entry contains a
> bunch of data about the address, phone etc. for that one job. Plus, it
> has 30 fields devoted to description, rate and pay for 10 line items.
>
> The important fields in the table are named as follows: The table is
> named ORDERS
>
> Item1Desc
> Item1Rate
> .
> .
> .
>
>
> The smaller table contains the descriptions for each line item and the
> rate associated with each one. The table is named LineItems
>
> ProductID
> ProductName
> UnitPrice
>
>
>
>
>
> The form goes like this:
>
> The Name of the Combo Box is 'Item1Desc' It's DataSource is also
> 'Item1Desc'. It's RowSource is:
>
> SELECT DISTINCT LineItems.ProductID, LineItems.ProductName FROM
> LineItems;
>
> The AfterUpdate Event is as follows:
>
> Private Sub ITEM_1_DESCRIPTION_AfterUpdate()
>
> Dim strFilter As String
>
> strFilter = "Item1Desc = " & Me!Item1Desc
>
> Me!Item1Rate = DLookup("UnitPrice", "LineItems", strFilter)
>
> End Sub
>
> The name of the TextBox to be filled in is "Item1Rate". It's
> DataSource is "Item1Rate"
>
> Now, I am not sure why the name "ITEM_1_DESCRIPTION" stuck on the
> subroutine, that is what the ComboBox and the field in the table used
> to be called, but I got sick of my own poor nomenclature.
>
> The problem is that the correct names etc show up in the ComboBox, but
> after I have selected the item, the rate does not fill in, it simply
> stays at the default value of 0.
>
> If anyone could help me solve this problem, I would be very very
> greatful. I cant tell you how long I have spent on this!!!
>
> Thank you all very much,
> Paul Hilgeman
>


.



Relevant Pages

  • Using a ComboBox selection to fill in other fields in form
    ... The Name of the Combo Box is 'Item1Desc' It's DataSource is also ... Private Sub ITEM_1_DESCRIPTION_AfterUpdate ... The name of the TextBox to be filled in is "Item1Rate". ... that is what the ComboBox and the field in the table used ...
    (microsoft.public.access.forms)
  • Re: Bindinglist und DataGridView
    ... Jetzt binde ich die BL_Kategorien an eine ComboBox ... Und an SelectedValue wird ein weiterer CurrencyManager angehängt, ... Ein DataGridist bindet ebenso an eine eigene DataSource. ... Nun sollte nun mit der DataGridViewComboBoxColumn gleiches wie bei der ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)
  • Re: ComboBox-DataSource ersten Wert nach Eingabe nicht automatisch setzen
    ... Liste gefiltert und die DataSource der ComboBox auf die gefilterte ... Private CBO As ComboBox ... End Sub ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: Call Back - Bloß wie?
    ... Natürlich sind DataSource für das Grid und die Comboboxen ... Die Combobox, welche in einer Zelle des Grids residiert ist an die ... Tabelle (table1) an, welche mit Table2 verknüpft ist. ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: Typecasting
    ... OK, its not complaining about accessing the DataSource property of the combobox, it complaining that the thing you are passing to Fill is typed as an object not a DataTable. ... Data can de entered programatically, by loading an XML document in or by using a DataAdapter. ...
    (microsoft.public.dotnet.languages.csharp)