Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / May 2005

Tip: Looking for answers? Try searching our database.

How do I make a text box value appear based on a combo box selecti

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig - 15 May 2005 17:09 GMT
I'm kind of new to this so please forgive, if I'm asking a somewhat basic
question. I have a supplier database that I'm trying to setup. I thought it
would be really keen to set it up so that when you entered the country it
would automatically list the international calling code in a text box next to
it for reference. Had no idea how difficult it would be!

What I thought I should do is create second table and corresponding form for
adding a country which stores the name of the country and its corresponding
calling code. Then I would use a combo box on my Add Supplier Form which
users would use to select the country, and once selected would cause the text
box for the dialing code to be automatically filled in by the corresponding
calling code of that country.

Any suggestions for how I would go about this? Its a fairly basic thing, I
think...

Cheers,

Craig
United Kingdom
Douglas J. Steele - 15 May 2005 17:48 GMT
Let's assume that the recordsource populating your combobox has two fields
in it: CountryCd and DialingCd, in that order.

In the combobox's AfterUpdate event, put code to populate the DialingCd text
box:

  Me.txtDialingCd = Me.cboCountry.Column(1)

The Column collection starts at 0, which is why you use Column(1) to refer
to the second column.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> I'm kind of new to this so please forgive, if I'm asking a somewhat basic
> question. I have a supplier database that I'm trying to setup. I thought
[quoted text clipped - 22 lines]
> Craig
> United Kingdom
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.