Connecting Tech Pros Worldwide Forums | Help | Site Map

Automatically get data in field when picking something in other field

jballard@acecwi.com
Guest
 
Posts: n/a
#1: Nov 13 '05
Hello,



I have a database set-up with a form and two subforms in it. I have one
of the subforms (replacement parts) set-up where you can pick part
numbers from a drop down box and also pick a description of the part
from a drop down box. These are two separate fields. I want to be able
to pick the part number and have it put in the description
automatically or the other way around. Which ever would by easier?



I have a table with just the part numbers and descriptions. Then I have
it adding this info into a main table in relation to the serial number
of the machine getting the replacement parts. Please help,


David Schofield
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Automatically get data in field when picking something in other field


On 15 Dec 2004 07:14:05 -0800, jballard@acecwi.com wrote:
[color=blue]
>Hello,
>
>
>
>I have a database set-up with a form and two subforms in it. I have one
>of the subforms (replacement parts) set-up where you can pick part
>numbers from a drop down box and also pick a description of the part
>from a drop down box. These are two separate fields. I want to be able
>to pick the part number and have it put in the description
>automatically or the other way around. Which ever would by easier?
>
>
>
>I have a table with just the part numbers and descriptions. Then I have
>it adding this info into a main table in relation to the serial number
>of the machine getting the replacement parts. Please help,
>[/color]

Hi
Not sure I understand this. If you have a table with fields PartNumber
and Description, and you have a combo box called combo1 which shows
PartNumber in the first (bound) column and Description in the second,
then when you pick a line combo1 will hold the value of PartNumber and
combo1.Column(1) will hold the value of the corresponding Description.
(Column numbering starts at zero).
David
jballard@acecwi.com
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Automatically get data in field when picking something in other field


I have a spot in a form and I want to pick an item from a drop down
list. Then after I pick that Description I want the next spot In the
form to auto fill in with the part number. My people know the
description but we don't have all the part numbers in our heads. So if
it would fill in after they pick the description.

David Schofield wrote:[color=blue]
> On 15 Dec 2004 07:14:05 -0800, jballard@acecwi.com wrote:
>[color=green]
> >Hello,
> >
> >
> >
> >I have a database set-up with a form and two subforms in it. I have[/color][/color]
one[color=blue][color=green]
> >of the subforms (replacement parts) set-up where you can pick part
> >numbers from a drop down box and also pick a description of the part
> >from a drop down box. These are two separate fields. I want to be[/color][/color]
able[color=blue][color=green]
> >to pick the part number and have it put in the description
> >automatically or the other way around. Which ever would by easier?
> >
> >
> >
> >I have a table with just the part numbers and descriptions. Then I[/color][/color]
have[color=blue][color=green]
> >it adding this info into a main table in relation to the serial[/color][/color]
number[color=blue][color=green]
> >of the machine getting the replacement parts. Please help,
> >[/color]
>
> Hi
> Not sure I understand this. If you have a table with fields[/color]
PartNumber[color=blue]
> and Description, and you have a combo box called combo1 which shows
> PartNumber in the first (bound) column and Description in the second,
> then when you pick a line combo1 will hold the value of PartNumber[/color]
and[color=blue]
> combo1.Column(1) will hold the value of the corresponding[/color]
Description.[color=blue]
> (Column numbering starts at zero).
> David[/color]

Bas Cost Budde
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Automatically get data in field when picking something in other field


jballard@acecwi.com wrote:[color=blue]
> I have a spot in a form and I want to pick an item from a drop down
> list. Then after I pick that Description I want the next spot In the
> form to auto fill in with the part number. My people know the
> description but we don't have all the part numbers in our heads. So if
> it would fill in after they pick the description.[/color]

You are not going to fill in *both* parts of information in that table,
are you? I may suggest you use two comboboxes, both on the article
number, both two-column, the one showing the description, the other
showing the part number.

Do you wish more detailed instructions?

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
jballard@acecwi.com
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Automatically get data in field when picking something in other field


When the form is up I want to fill in one part and then have the other
part fill in auto. So when I choose description form a drop down then
as soon a I choose it the part number fills in another field auto. Yes
please step by step directions.

Bas Cost Budde
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Automatically get data in field when picking something in other field


jballard@acecwi.com wrote:[color=blue]
> When the form is up I want to fill in one part and then have the other
> part fill in auto. So when I choose description form a drop down then
> as soon a I choose it the part number fills in another field auto. Yes
> please step by step directions.[/color]

To enter the part number into the table, whereas the user sees the
description, you use a combobox.
Set its controlsource (that is what it stores and retrieves) to the part
number field.
Its rowsource (that is what you see on dropdown) becomes a two column
query, tapping on the product description table. First column is the
part number, second column the description. Be sure to set the Columns
property to 2.
Now, set the ColumnWidths property to 0. That means you hide the first
column.

When you want to see the part number, as well as enter it by
description, you add another combobox--or simply another text
field--with the part number as its controlsource.
You can set the control Locked (optionally Not Enabled) if you don't
want to bother/confuse the user by providing two inputs for one item of
information. I think you should do that. OTOH I like numbers and would
certainly appreciate the ability to also enter by product number.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
jballard@acecwi.com
Guest
 
Posts: n/a
#7: Nov 13 '05

re: Automatically get data in field when picking something in other field


That works out good.

Now I have a combo box that has part number and description to choose
the part number field. When I choose one it only lists the part number
in the field (this is what I want).Then I have the same but turned
around to choose the description field. When I choose one it only
enters the description. (this is what I want) Good so Far.

Is there a way that I can only have one combo Box with the part numder
and description to choose the part number field and then have Access
fill in the description field for me without having to go to the next
combo Box and choosing again to enter in the description field. If not
that is fine. This works pretty good. If there is though I could choose
this once and have it fillin the descripton, price, bin #, ext.
Automatically by just choosing from the combo box I created.

Bas Cost Budde
Guest
 
Posts: n/a
#8: Nov 13 '05

re: Automatically get data in field when picking something in other field


jballard@acecwi.com wrote:[color=blue]
> That works out good.
>
> Is there a way that I can only have one combo Box with the part numder
> and description to choose the part number field and then have Access
> fill in the description field for me without having to go to the next
> combo Box and choosing again to enter in the description field.[/color]

Yes.

Have the form open in design view and select the first combobox. View
its properties, tab Events. At OnClick, select the value [Event
Procedure] from the list. Click the button with three dots.

You arrive at the code module of the form. At the white line, type

me.recalc

I think that is all it takes to recalculate the second combobox.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Closed Thread