Solved

MS Access: passing value from combo box to text box

Posted on 2009-04-07
5
437 Views
Last Modified: 2013-11-28
This should be a straightforward question, but I am having trouble figuring it out.

I have a single-record form based on one table.  I put an unbound combo box on the form (in the details section) that pulls its values from the same table:

SELECT tblBorrowInquiries.BorrowerInquiryID, tblBorrowInquiries.BorrowerName FROM tblBorrowInquiries;

I want the combo box to pass the value selected by the user to a text box (txtBorrowerInquiryID which has as its control source BorrowerInquiryID) and thus change the record displayed.  I used the following in the after-update of the combo box:

Me.txtBorrowerInquiryID.Value = Me.cboBorrowerInquirySelect.Value

Needless to say, I am getting the runtime error 2448 when I try to select a new record in my combo box and can't change the text box.  I had this working, but must have changed something.
0
Comment
Question by:Phereklos
[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
  • 2
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24088823
just use

Me.txtBorrowerInquiryID = Me.cboBorrowerInquirySelect

0
 
LVL 77

Expert Comment

by:peter57r
ID: 24088868
'and thus change the record displayed'

Can you be quite clear what you mean by this.

Do you mean
A)you want the data in the current record to be modified?
Or
B)Are you trying to move to a different record?

You are doing A, not B.
0
 

Author Comment

by:Phereklos
ID: 24088927
Thanks.  I want to move to a different record.  How do I do that?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 24088962
Delete the combo box.
Add it again using the controls wizard and this time choose the option to 'find a record in my form'
0
 

Author Comment

by:Phereklos
ID: 24089163
Thanks.  I had first put the combo box on the form using the wizard, but changed something and it stopped working (still can't figure out why).  Didn't think to simply start over.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

695 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