473,574 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2361
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********@yah oo.com> wrote in message
news:a9******** *************** **@posting.goog le.com...
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
2176
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: Objectives The purpose of this assignment is to have you practice the design of object-oriented classes, including one or more of the following...
0
1830
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, all dont work "Re:" need help "Re:need help"
1
3318
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 from VBScript to C# (*.vbs --> *.cs). Does C# have a native method for doing what MSWC.PermissionChecker used to do? If so has anyone gone...
2
1474
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 where users can have profiles (as with most websites) but each users home page (profile page) will/should have the ability to be dynamic and...
10
2566
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 tool you know how to use is a hammer, every problem tends to look like a nail. That said, I could solve my problem in C, but it's not the right...
23
2518
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
2730
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 the sequence nos and it should be such that i can access it through the structure .plz help me .
0
3933
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 Inbox Reply from Craig Somerford <uscos@2barter.net> hide details 10:25 pm (3 minutes ago)
2
2447
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 values from. For example, the XML file is meant to return the values from node"config2", because the "configoption" node's value is that. I'm...
1
1727
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 someone who knows how to help a person without making them feel like they are a complete idiot can help me. I need to know how to code a nav/menu...
0
7832
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8093
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8262
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8129
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6498
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5331
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1364
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1094
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.