473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Need help! Trying to auto fill in a form

I am going nuts trying to figure this out, any help will be
appreciated.

I have an existing table called "Parts". And in this table I have the
following columns:
"ID" "Part Number" "Part Description" "Part Cost"

I am trying to build an order form that will have "Part Number" and
"Part Cost" both on the form and in that forms specific table.

This is what I want to accomplish: When I am filling out the order
form, I want a drop down box with the list of the Part Numbers from
the Parts table. When I select the part number, I want the Part Cost
field to auto fill with the corresponding part cost. In addition to
this, once I get past that hurtle, I'd like to be able to choose
multiple parts.

I've seen this on an existing access db, but can not figure out how
it's being done.

Thanks in advance!
Nov 12 '05 #1
3 2341
On 9 Feb 2004 08:58:45 -0800, MatGyver wrote:
I am going nuts trying to figure this out, any help will be
appreciated.

I have an existing table called "Parts". And in this table I have the
following columns:
"ID" "Part Number" "Part Description" "Part Cost"

I am trying to build an order form that will have "Part Number" and
"Part Cost" both on the form and in that forms specific table.

This is what I want to accomplish: When I am filling out the order
form, I want a drop down box with the list of the Part Numbers from
the Parts table. When I select the part number, I want the Part Cost
field to auto fill with the corresponding part cost. In addition to
this, once I get past that hurtle, I'd like to be able to choose
multiple parts.

I've seen this on an existing access db, but can not figure out how
it's being done.

Thanks in advance!


I think what you are trying to do here is usually setup as a detail section
of an Order Header -> Order Detail scenario. Usually the order header is on
a main form, and the deatils are in a subform (datasheet or otherwise).
Using a datasheet or continuous form on the details table allows you to
select multiple items for the order, adding a new row for each new item.
To make your combobox, add one to the form, set it's RowSource to following
SQL...

SELECT tp.ID, tp.[Part Number], tp.[Part Description], tp.[Part Cost] FROM
Parts tp;

Set whatever other properties you need like the BoundColumn, Columns,
Column Widths etc. In the AfterUpdate event add...

(Assuming combo is called Part Number and there is a textbox called Part
Cost)
Me![Part Cost] = Me![Part Number].Column(1) 'Gets value in sec. column

--
Mike Storr
veraccess.com
Nov 12 '05 #2
This is in the right direction of what I want to accomplish, but when
I follow these instructions, I get the ID# in the part number drop
down, and the Part number in the Part cost field. It looks like it's
just one column off. I've played with this for a while today so not to
bother anyone anymore, but again I'm stuck.

Thanks again!
I think what you are trying to do here is usually setup as a detail section
of an Order Header -> Order Detail scenario. Usually the order header is on
a main form, and the deatils are in a subform (datasheet or otherwise).
Using a datasheet or continuous form on the details table allows you to
select multiple items for the order, adding a new row for each new item.
To make your combobox, add one to the form, set it's RowSource to following
SQL...

SELECT tp.ID, tp.[Part Number], tp.[Part Description], tp.[Part Cost] FROM
Parts tp;

Set whatever other properties you need like the BoundColumn, Columns,
Column Widths etc. In the AfterUpdate event add...

(Assuming combo is called Part Number and there is a textbox called Part
Cost)
Me![Part Cost] = Me![Part Number].Column(1) 'Gets value in sec. column

Nov 12 '05 #3
The columns have a 0 based index, so if you want the 3rd field in the query,
then use 2 as the column index ie. .Column(2)
"MatGyver" <mh********@yahoo.com> wrote in message
news:a9*************************@posting.google.co m...
This is in the right direction of what I want to accomplish, but when
I follow these instructions, I get the ID# in the part number drop
down, and the Part number in the Part cost field. It looks like it's
just one column off. I've played with this for a while today so not to
bother anyone anymore, but again I'm stuck.

Thanks again!
I think what you are trying to do here is usually setup as a detail section of an Order Header -> Order Detail scenario. Usually the order header is on a main form, and the deatils are in a subform (datasheet or otherwise).
Using a datasheet or continuous form on the details table allows you to
select multiple items for the order, adding a new row for each new item.
To make your combobox, add one to the form, set it's RowSource to following SQL...

SELECT tp.ID, tp.[Part Number], tp.[Part Description], tp.[Part Cost] FROM Parts tp;

Set whatever other properties you need like the BoundColumn, Columns,
Column Widths etc. In the AfterUpdate event add...

(Assuming combo is called Part Number and there is a textbox called Part
Cost)
Me![Part Cost] = Me![Part Number].Column(1) 'Gets value in sec. column

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Flynn | last post by:
hi all i'm going to be quick i have an assignment due which i have no idea how to do. i work full time so i dont have the time to learn it and its due date has crept up on me .. As follows:...
0
by: xunling | last post by:
i have a question about answering ..... this topic is "need help" what do i have to write at te topic line, !after i have klicked the "answer message" button ive tried many possibilities,...
1
by: MSDN Account | last post by:
We have web site that used the IIS ResKit tool MSWC.PermissionChecker to check file permissions. The web site has been upgraded and that upgrade included changing the default server side language...
2
by: bryan | last post by:
I have a situation that's pretty delicate that I need some help on. I've been stumped for awhile I just need some advice on the best possible solution. The problem: I have a site I'm making...
10
by: L. R. Du Broff | last post by:
I own a small business. Need to track a few hundred pieces of rental equipment that can be in any of a few dozen locations. I'm an old-time C language programmer (UNIX environment). If the only...
23
by: vinod.bhavnani | last post by:
Hello all, I need desperate help Here is the problem: My problem today is with multidimensional arrays. Lets say i have an array A this is a 4 dimensional static array.
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
2
by: XML Beginner | last post by:
I have an XML file that contains values that my application needs, so it knows which database to connect to. It also contains a configuration option so that I can specify which node to return...
1
by: jhaydon | last post by:
First of all, I'm not a CSS expert. If I was, I wouldn't need to be posting for help here. Secondly, I have been doing web design for several years, just not css. Thirdly, I need help and hope...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.