Solved

MS Access: passing value from combo box to text box

Posted on 2009-04-07
5
436 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

726 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