A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

auto populate text box based on combo box value



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2010, 10:21 PM posted to microsoft.public.access.forms
Yappy
external usenet poster
 
Posts: 7
Default auto populate text box based on combo box value

I would like to set up the following to auto populate the fields below based
on the value I select in the combo box:
Rep field = combo box (LURequestor) with all info included pertaining to the
rep
The combo box row/source type is Table/Query; row source is SELECT
qryReps.FullName, qryReps.[Last Name], qryReps.[First Name],
qryReps.RegionNumber, qryReps.Region, qryReps.Division,
qryReps.[RSM-Director] FROM qryReps ORDER BY qryReps.FullName; & RepID is
hidden

Region Number = unbound text box (Column 4)
Region = unbound text box (Column 5)
Manager = unbound text box (Column 7)
Division = unbound text box (Column 6)

I have tried setting up the text boxes with =[LURequestor].[Column](4) in
each unbound text box with the respective column number but the form shows
"#Name?" in the field.

I am using Access 2003. What could I be doing wrong? Any help would be
appreciated.

Yappy
Ads
  #2  
Old May 27th, 2010, 10:24 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default auto populate text box based on combo box value

Yappy -

You need to use the AfterUpdate event of the combo box to populate the other
fields. For the combo box, Column(0) is the first column, so adjust as
needed. The code will look something like this, one line for each unbound
text box (use your control names):

Me.[Region Number] = Me.LURequestor.Column(5)
Me.[Region] = Me.LuRequestor.Column(6)


--
Daryl S


"Yappy" wrote:

I would like to set up the following to auto populate the fields below based
on the value I select in the combo box:
Rep field = combo box (LURequestor) with all info included pertaining to the
rep
The combo box row/source type is Table/Query; row source is SELECT
qryReps.FullName, qryReps.[Last Name], qryReps.[First Name],
qryReps.RegionNumber, qryReps.Region, qryReps.Division,
qryReps.[RSM-Director] FROM qryReps ORDER BY qryReps.FullName; & RepID is
hidden

Region Number = unbound text box (Column 4)
Region = unbound text box (Column 5)
Manager = unbound text box (Column 7)
Division = unbound text box (Column 6)

I have tried setting up the text boxes with =[LURequestor].[Column](4) in
each unbound text box with the respective column number but the form shows
"#Name?" in the field.

I am using Access 2003. What could I be doing wrong? Any help would be
appreciated.

Yappy

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 OfficeFrustration.
The comments are property of their posters.