Solved

Look up records using a combobox and textbox

Posted on 2013-05-10
4
358 Views
Last Modified: 2013-05-29
I have an access form with a combobox and a textbox on it.

I have a table with 4 fields.  Fields 1, 2 and 3 combined make up the primary key.  Field 4 is a currency field.

The combo box uses Fields 1, 2 and 3 to look up a record.  I want Field 4 of the record to be displayed in a textbox for editing.  How do I do this?  Thanks.
0
Comment
Question by:dbfromnewjersey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

Expert Comment

by:als315
ID: 39155918
May be you can upload sample DB with this form and table only?
0
 

Author Comment

by:dbfromnewjersey
ID: 39155980
All I want is for Field4 to be displayed in a textbox when a selection is made from the combobox.   The combobox uses the primary key (Field1,Field2 and Field3) to look up a record. I just want Field4 of that record to be displayed in a textbox.

To simplify even more, presume the table only has 2 fields.  Say Field1 is the primary key and Field2 is a currency field. I use the combobox to select a Field1 value.  I want the associated Field2 value to be displayed in the textbox upon a combobox selection.
0
 
LVL 40

Assisted Solution

by:als315
als315 earned 50 total points
ID: 39156131
You've started from:
"to be displayed in a textbox for editing" - do you like to edit record in table or only display it?
For second:
Add to form unbounded field and assing it's value to:
=[ComboBoxName].[Column](1)
Column numbers are started from 0.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 200 total points
ID: 39157050
dbfromnewjersey
<May be you can upload sample DB with this form and table only? >
Agreed, from your experience here you know that posting a sample a sample db always makes it easier to see what you have, thus shortening the time to get a solution...
;-)

In any event I am not quite sure how your combobox "Looks up" a record, but if it finds the Primary key, you can move to that record and display/edit the Price field (using a bound form)

You can also use an SQL update query if the form is unbound

Sample of both attached
Database221.mdb
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question