Have combo box fill several fields on form

N

Nmex Ron

In Access 2007, I would like to select the data from one combo box, and have
it placed simultaneously in three fields on the same form. I have the form
and combo box constructed, and can see the data in the combo fields -- but
(as normal) it only fills in one field. The data in the combo box is all
coming from one query.
Thanks.
 
B

bhipwell via AccessMonster.com

AfterUpdate

Me.Field1 = Me.Combo
Me.Field2 = Me.Combo
Me.Field3 = Me.Combo
 
N

Nmex Ron

Thanks for your reply, I tried this but get error messages I must have
something constructed wrong -- can you plese correct or clarify?

Me.Envelope# = Me.Envelope#
Me.Parishioner = Me.Parishioner
Me.Parish = Me.Parish

I also tried this:
Me.Envelope# = Me.Envelope#.Envelope#
Me.Parishioner = Me.Envelope#.Parishioner
Me.Parish = Me.Envelope#.Parish

Still NO GO

I appreciate your help.
Thanks
 
S

steve

PMFJI
the columns of a combo box are numbered starting with 0 column(0) etc.

HTH
Steve
 
J

John W. Vinson

In Access 2007, I would like to select the data from one combo box, and have
it placed simultaneously in three fields on the same form. I have the form
and combo box constructed, and can see the data in the combo fields -- but
(as normal) it only fills in one field. The data in the combo box is all
coming from one query.
Thanks.

You almost certainly do NOT want to do this. If you're trying to copy data
from one table into another table, your table structure is probably incorrect!

Relational databases use the "Grandmother's Pantry Principle": "A place - ONE
place! - for everything, everything in its place". Rather than storing the
parish, or parishoner, in a second table, just store the unique primary key ID
(the envelope number perhaps??) and use Queries to look it up.

John W. Vinson [MVP]
 
B

bhipwell via AccessMonster.com

John is absolutely correct if you are tying the fields you are trying to fill
into other tables. I did not gather that this was your objective, however,
from your original post.

B
 
N

Nmex Ron

The envelope number can change from year to year, so I need the entry in two
different tables. One for the current envelope number assigned to the
parishioner for this year, and one to record that number for posterity. The
field “Parishioner†is the unique primary key ID, named “Family #†in the
main table.

I renamed the field “EnvNum†in the main table (instead of Envelope#) and
“EnvNumC†in the “Contributions†table I am using the form to fill.

I have tried for hours to get this to work with no success; nothing ever
appears in the “Parishioner†or “EnvNumC†fields.

I also remade querys and remade the complete form = nothing.
This is what I now have in the afterupdate event of the existing combo box
“EnvNumCâ€: me.Parishioner=me.EnvNumC.column(5)
I am counting the first field as zero.

Any additional suggestions would be appreciated.
Thanks - Ron
 
A

Anthos

Is it a Multiselect List?
as this will have a bearing on how you reference items in that list.
 
N

Nmex Ron

If you are referring to the new feature available in Access07 were you can
put multiple items in one field then the answer is no. Otherwise I am not
sure what you mean by Multiselect.
Ron
 
N

Nmex Ron

Additional information about this combo box issue.
I was using a datasheet form, now I tried a “one record at a time form†and
entered the same line into the After Update event of the existing combo box
“EnvNumCâ€:
me.Parishioner=me.EnvNumC.column(5)
I get this error message on the new form:
“If ‘me’ is a new macro or macro group, make sure you have saved it and that
you have typed its name correctly.â€
Then this in the rest of the help message: ---------------------------
Access was unable to locate the macro or VBA function. If you are trying to
call a macro, make sure that the name of the macro and the name of the macro
group are spelled correctly.
If you are trying to call a user-defined VBA function, be sure to use the
following syntax:
=FunctionName() or =FunctionName(argument1,argument2,...)
Make sure that the function is either:
• Defined in the code for the form or report.
• - or -
• A public function that is in a module (not a class module).
----------------------------
I cannot find the expression “me.†anywhere in help, can you tell more about
it? Is this a public function or?

I appreciate all help.
Thanks -- Ron
 
A

Anthos

Is it a Multiselect List?
as this will have a bearing on how you reference items in that list.

I apologise, I was refering to a list box in my previous statement,
not a combo box.
Hope this clears up some confusion.
 
N

Nmex Ron

Problem solved – I did not know (and no one said) that these commands must be
put into an “Event Procedureâ€. As soon as I did this everything worked.

Probably taken for granted, however I am first a retired soldier, then a
rancher, and somewhere down the line I attempt to develop Access databases.
An American general once said “Don’t give orders so that they can be
understood, give them so that they cannot be misunderstood.â€

Thanks for all the replies.
Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top