Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

MS Access: passing value from combo box to text box

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
Phereklos
Asked:
Phereklos
  • 2
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
just use

Me.txtBorrowerInquiryID = Me.cboBorrowerInquirySelect

0
 
peter57rCommented:
'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
 
PhereklosAuthor Commented:
Thanks.  I want to move to a different record.  How do I do that?
0
 
peter57rCommented:
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
 
PhereklosAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now