Solved

Look up records using a combobox and textbox

Posted on 2013-05-10
4
355 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
  • 2
4 Comments
 
LVL 39

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 39

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now