Combo Box help

Irish_Griffin

Registered User.
Local time
Yesterday, 19:30
Joined
Aug 29, 2007
Messages
15
Hi All,
I've got a challenge for you, well at least it's a challenge for me :p

now I just need to explain it clearly.....

subform pulls from qry#1 ->
subform.txtbox value is used to filter qry#2 ->
qry#2 is the row source for my combo box

When I select from the combo box, I want multiple field values from qry#2 be transferred onto my sub form.

Hope that is clear.

currently I have the combo box working and it's "control source" transfers one field value onto the subform.

Help would be AWSOME
-Aaron
 
The values in columns in a combobox are refered to:
Code:
Forms!mainformname!subformcontrolname!comboboxname.column(x).value
where x starts at zero for the first column.

Set a textbox control source to this reference and it will track the value.

The default property of the combo is the value of the bound field which is what you are currently reading.

If the textboxes are to be saved through being bound to a table then their value must be set in the OnUpdate event procedure of the combo.
 
Here is a clearer way to state the question:

How do I pull multiple field values after a selection occurs on a combo box.

Example:

Qry fields:

1 A #
2 B $
3 C %


Combo box lists 1,2,3

User selects "1"

VBA code results:
variable1 = "1"
variable2 = "A"
variable3 = "#"
 
The values in columns in a combobox are refered to:
Code:
Forms!mainformname!subformcontrolname!comboboxname.column(x).value
where x starts at zero for the first column.

Set a textbox control source to this reference and it will track the value.

The default property of the combo is the value of the bound field which is what you are currently reading.

If the textboxes are to be saved through being bound to a table then their value must be set in the OnUpdate event procedure of the combo.

cool, I think I can make this work =-)
 
Set a textbox control source to this reference and it will track the value.


If the textboxes are to be saved through being bound to a table then their value must be set in the OnUpdate event procedure of the combo.

Not following you here......

my combo box does not have an onUpdate Event (2003)

after update
before update
on change
I tried the follow code:

Code:
Dim test As String
test = Forms![main_form]![Part_Subform]![Combo119].Column(4).Value
MsgBox (test)
no worky =-(
 
Sorry. After Update.

Do you get an error or just an empty string in your variable?
Is that field from the row source definitely a string?
Column indexes start at (0).

[Part_Subform] is the subform control name on the main form not the subform object itself.
 
Sorry. After Update.

Do you get an error or just an empty string in your variable?
Is that field from the row source definitely a string?
Column indexes start at (0).

[Part_Subform] is the subform control name on the main form not the subform object itself.

codes in after update event
column(0-4) are strings (5 total)
no blank fields
[part_subform] is the name of the form and the name of the subform control
..............

what should be in the control source of the combo box?
 
Technically the full reference is:
Code:
 Forms![main_form]![Part_Subform].Form![Combo119].Column(4).Value

.Form is the default property of the form. But, for reasons I have never established, some references appear to demand its inclusion.

The combo's control source is the bound field from the record source if that is how it is being used. This will cause it to display that field from the current record.

This would also mean the text boxes were unbound since they are merely displaying the related values from the combo's row source. To bind them to the the record source would indicate that derived values were being stored.

The population of bound text boxes using the After Update event would only be done in a data entry form where the row source of the combo was dynamic and could not be redetermined when existing records were redisplayed. This would be an unusual situation.

Hope this makes sense.
 

Users who are viewing this thread

Back
Top Bottom