Have combo box fill several fields on form

Nmex Ron

Registered User.
Local time
Yesterday, 17:21
Joined
Aug 14, 2007
Messages
20
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.
 
in the afterupdate event of the combo box put

me.yourfieldname=me.yourcomboboxname.column(the number column that holds the information that you want)
 
I entered this in the afterupdate event of the existing combo box.
me.Parishioner=me.Envelope#.6

It accepted the entry, but nothing happens.

Likely I am not constructing this correctly.

"Parishioner" is the field I am trying to get it to fill. (one of two)
"Envelope#" is the apparent name of the existing combo box.
"6" is the sixth column of "Parishioner" in the existing combo box.

I also tied this:
me.Parishioner=me.Envelope#.column6


I appreciate your help - Thanks
 
I entered this in the afterupdate event of the existing combo box.
me.Parishioner=me.Envelope#.6

It accepted the entry, but nothing happens.

Likely I am not constructing this correctly.

"Parishioner" is the field I am trying to get it to fill. (one of two)
"Envelope#" is the apparent name of the existing combo box.
"6" is the sixth column of "Parishioner" in the existing combo box.

I also tied this:
me.Parishioner=me.Envelope#.column6


I appreciate your help - Thanks

quick note. you shouldnt name the combo box envelope#
try envelopenum or something along those lines

me.Parishioner=me.Envelope#.column(6)

also remember that the numbering starts at 0 so its possible that it may be column 5
 
I have tried for hours to get this to work with no success; nothing ever appears in the Parishioner field.
I renamed the field “EnvNum” in the main table (instead of Envelope#) and “EnvNumC” in the table I am using the form to fill (the envelope number can change from year to year so I need the entry in two different tables).
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)

Any additional suggestions would be appreciated.
Thanks - 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
 
can you post a sample of your database so one of us can take a look at it?

and me refers to the control on the active form. form, txtbox etc
 
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
 
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

apologies for this! glad you got it figured out
 

Users who are viewing this thread

Back
Top Bottom