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  

How to get one field to update based on a selection from a drop do



 
 
Thread Tools Display Modes
  #1  
Old May 13th, 2010, 04:56 PM posted to microsoft.public.access.forms
RMorton
external usenet poster
 
Posts: 1
Default How to get one field to update based on a selection from a drop do

New to Access. I want to create a form that coworkers can use to lookup
information in a database for inputting data into a PO as well as submit new
records into the database. I want to have a control that is a combo drop down
box where the can select a row from a list of items in a specified field and
based on that selection it will update the below text box control with the
corresponding data in the field next to it on the database. Make sense?
Basically need to figure out how to update one control based on data selected
from the drop down box control above it???
  #2  
Old May 13th, 2010, 06:56 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default How to get one field to update based on a selection from a drop do

Private Sub YourComboBox_AfterUpdate()
Me.TextBoxName = Me.YourComboBox.Column(X)
End Sub

where the X is an integer designating the column of the combobox you want to
populate the Textbox. This is Zero-based, so reading the combobox Left-to-
Right, if you have, say, fields

PO_Num, Company, ContactName

and you wanted the textbox to be populated with the PO_Num, you'd use

Me.TextBoxName = Me.YourComboBox.Column(0)

For the Company name

Me.TextBoxName = Me.YourComboBox.Column(1)

And likewise, for the ContactName

Me.TextBoxName = Me.YourComboBox.Column(2)

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

  #3  
Old May 13th, 2010, 07:31 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default How to get one field to update based on a selection from a drop do

The standard search form is to use a combo. Allow the combo wizard to do that
for you and select the field you want to search on. Then right click on the
combo to get properties, go to events, and then select the afterupdate event.
Type:
Me.filter = "[yourfieldyouaresearchingon] = """ % Me.combo# & """"
me.filteron = true
The combo# will be listed, like combo22 or combo10.
--
Milton Purdy
ACCESS
State of Arkansas


"RMorton" wrote:

New to Access. I want to create a form that coworkers can use to lookup
information in a database for inputting data into a PO as well as submit new
records into the database. I want to have a control that is a combo drop down
box where the can select a row from a list of items in a specified field and
based on that selection it will update the below text box control with the
corresponding data in the field next to it on the database. Make sense?
Basically need to figure out how to update one control based on data selected
from the drop down box control above it???

 




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 03:16 PM.


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