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  

Combo Box matching to entire record



 
 
Thread Tools Display Modes
  #1  
Old January 22nd, 2010, 07:47 PM posted to microsoft.public.access.forms
Kathy
external usenet poster
 
Posts: 641
Default Combo Box matching to entire record

I have a combo box on a form that contains ID numbers and various other
fields from the table. I want to be able to select the ID number from the
combo box and have it populate other fields from the individual record. I
was thinking I needed to enter something for "after update" on the properties
for after selecting the ID number, but have not been able to get it to work.
Any suggestions?
  #2  
Old January 22nd, 2010, 08:01 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default Combo Box matching to entire record

Use:
Me.filter = "[id] = """ & Me.combo# & """"
Me.filteron = True

Put this in the afterupdate of the combo. Your combo# will be listed, like
combo10 or combo18.
--
Milton Purdy
ACCESS
State of Arkansas


"Kathy" wrote:

I have a combo box on a form that contains ID numbers and various other
fields from the table. I want to be able to select the ID number from the
combo box and have it populate other fields from the individual record. I
was thinking I needed to enter something for "after update" on the properties
for after selecting the ID number, but have not been able to get it to work.
Any suggestions?

  #3  
Old January 22nd, 2010, 08:01 PM posted to microsoft.public.access.forms
Chegu Tom
external usenet poster
 
Posts: 140
Default Combo Box matching to entire record

Once you have selected a record in your combo box (called combo1 and having
several columns 0-5)

you can assign values from each of the columns to controls on your form
using the column property of the combo box. Column counts start with ZERO

to copy the first three columns of hte combo box into three controls on you
form (text1 text2 text3)

in the after update event of the combo box place code like this (replacing
text1, combo1 etc with your names)

me.text1=me.combo1.column(0)
me.text2=me.combo1.column(1)
me.text3=me.combo1.column(2)

Tom



"Kathy" wrote in message
...
I have a combo box on a form that contains ID numbers and various other
fields from the table. I want to be able to select the ID number from the
combo box and have it populate other fields from the individual record. I
was thinking I needed to enter something for "after update" on the
properties
for after selecting the ID number, but have not been able to get it to
work.
Any suggestions?



  #4  
Old January 22nd, 2010, 08:47 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Combo Box matching to entire record

On Fri, 22 Jan 2010 11:47:02 -0800, Kathy
wrote:

I have a combo box on a form that contains ID numbers and various other
fields from the table. I want to be able to select the ID number from the
combo box and have it populate other fields from the individual record. I
was thinking I needed to enter something for "after update" on the properties
for after selecting the ID number, but have not been able to get it to work.
Any suggestions?


If you're trying to copy field values from one table (the combo's rowsource)
into a different table (the form's recordsource).... DON'T. Storing data
redundantly is almost always A Bad Idea.

Could you explain just what you're trying to accomplish with this?
--

John W. Vinson [MVP]
  #5  
Old January 22nd, 2010, 10:18 PM posted to microsoft.public.access.forms
Kathy
external usenet poster
 
Posts: 641
Default Combo Box matching to entire record

I'm trying to create a form that has look up information on one side and data
entry information on the other side. I want to be able to have the combo box
on the look up side where someone could choose the ID number for the record
they are looking for and the corresponding field information would appear so
they could verify they have the correct record. Then, I want them to be able
to enter information on the data entry side for additional information
related to that record.


"John W. Vinson" wrote:

On Fri, 22 Jan 2010 11:47:02 -0800, Kathy
wrote:

I have a combo box on a form that contains ID numbers and various other
fields from the table. I want to be able to select the ID number from the
combo box and have it populate other fields from the individual record. I
was thinking I needed to enter something for "after update" on the properties
for after selecting the ID number, but have not been able to get it to work.
Any suggestions?


If you're trying to copy field values from one table (the combo's rowsource)
into a different table (the form's recordsource).... DON'T. Storing data
redundantly is almost always A Bad Idea.

Could you explain just what you're trying to accomplish with this?
--

John W. Vinson [MVP]
.

  #6  
Old January 23rd, 2010, 01:16 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Combo Box matching to entire record

On Fri, 22 Jan 2010 14:18:01 -0800, Kathy
wrote:

I'm trying to create a form that has look up information on one side and data
entry information on the other side. I want to be able to have the combo box
on the look up side where someone could choose the ID number for the record
they are looking for and the corresponding field information would appear so
they could verify they have the correct record. Then, I want them to be able
to enter information on the data entry side for additional information
related to that record.


Is the "additional information" in the same table? Or is it in a separate
(many side) table, which could be edited in a Subform?

It *SOUNDS* like what you want to do is to use a combo box to locate and
display an existing record. If so, use the Toolbox Combo Box Wizard to create
a combo "Use this combo to find a record". The user shouldn't need to even SEE
an ID number, unless ID numbers are in routine use out in the real world.

You can display (without storing) information from multiple columns in the
combo box by having textboxes with control sources like

=comboboxname.Column(n)

where (n) is the zero based index of the field - e.g. if the Phone is the
fifth column of the combo's row source query, use (4).
--

John W. Vinson [MVP]
 




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:34 AM.


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