?
Solved

MS Access: passing value from combo box to text box

Posted on 2009-04-07
5
Medium Priority
?
439 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 2000 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

764 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