Solved

Look up records using a combobox and textbox

Posted on 2013-05-10
4
354 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

21 Experts available now in Live!

Get 1:1 Help Now