Re: Using a ComboBox selection to fill in other fields in form
- From: "Ken Snell \(MVP\)" <kthsneisllis9@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 12 Jan 2006 00:00:39 -0500
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
>
.
- Follow-Ups:
- Re: Using a ComboBox selection to fill in other fields in form
- From: PaulHilgeman
- Re: Using a ComboBox selection to fill in other fields in form
- References:
- Using a ComboBox selection to fill in other fields in form
- From: PaulHilgeman
- Using a ComboBox selection to fill in other fields in form
- Prev by Date: Re: Export to Excel
- Next by Date: Re: Searching for Lowercase string
- Previous by thread: Using a ComboBox selection to fill in other fields in form
- Next by thread: Re: Using a ComboBox selection to fill in other fields in form
- Index(es):
Relevant Pages
|