Retrieving a combo box column from subform

Magster

Registered User.
Local time
Today, 15:25
Joined
Jul 30, 2008
Messages
115
Hi all - I hope that I explained this so it could understood...

I am trying to retrieve a column's value from a combo box. I have a 4 tiered relationship and I put the first tier on the frmProjects, the 2nd level goes on the frmProjectAssignments and the 3rd tab is a child of Assignments, and it is frmProjectAssignmentsTasks. These are the names of the forms and they are also the name of the subform on frmProjects. I am using tabs to display the subforms.

While on the third tab, I want to check the 2nd column of a combo box located on the 2nd level frmProjectAssignments form.

The following works and displays a text field called intAssignment No
[frmProjects]![frmProjectAssignments].form.intAssignmentNo

The following displays the first column of the combo box, but I can' get the 2nd column to print its value.
forms![frmProjects]![frmProjectAssignments].form.cboResponsibleEmployee

All suggestions would be appreciated.
Thx!
 
Try

forms![frmProjects]![frmProjectAssignments].form.cboResponsibleEmployee.Column(1)

The column property is zero based, so 1 is the second column.
 
Thanks Paul - but that doesn't work either.

I've tried all kinds of combinations of form! and form. etc... but nothing seems to work. I have about 7 columns on the combo box, and the only value I can get is column 0 without including .column(0)

Any other ideas?
 
Make sure the Column Count property of that combo has been set correctly (7).
 
The combo box is fine - I use it from it's parent form just fine... I think I'll just find another way around this for now. Thanks for your help
 
If you are using it as a control source for a text box then the syntax is slightly different:

=[frmProjectAssignments].[Form]![cboResponsibleEmployee].[Column](1)

And make sure that you are referencing the SUBFORM CONTROL (control on the main form that houses the subform) and NOT the subform name itself, if the two are different.

See here for an example of which name you want to use:

subformcontrol.png
 
The combo box is fine - I use it from it's parent form just fine... I think I'll just find another way around this for now. Thanks for your help

Does this mean that you checked the Column Count property? Do you get the other columns from the parent?
 
The column count is correct. I can get to any of the columns when I'm on the form that the cbo is on. However, when I am on a different tab which has a child table of the tab that the combo box is on - it won't work. I went all the way up to the Forms! level and came down the Project, then to the assignment level form that has the combo box.

I believe it is just syntax that I'm messing up. I can get the bound column of the cbo from the subform in question without including the column(n), I just can't get to the remainder of the columns.
 
Any chance of getting an upload of the database here (even if you clear out any sensitive data)? I think we could get this fixed quickly if we could see the database and see where and what you are trying to do.
 
Sure, I can do that tomorrow. I'd really like to see what I'm doing wrong.

Thanks!
 
I can get the bound column of the cbo from the subform in question without including the column(n), I just can't get to the remainder of the columns.

That is very odd. Clearly you are addressing the combo correctly from the other subform or you would not get the bound column. And you can get the other columns when you are on the same form so the column count is also valid.

I'm looking forward to the answer for this one.

If all else fails a workaround to try would be placing an invisible textbox on the same form as the combo with the control source:
=combobox.Column(x)

Then address that textbox from the other subform.
 
Thanks to everyone for the suggestions...

I’ve been out sick for 4 days and now I have to get moving on this project – so unfortunately, I’ve had to create a work-around this issue and let it go.

Sure does bug me though…. Maybe I’ll get some time in the near future and look again. Again - Thanks to those who responded to my request for help!
 

Users who are viewing this thread

Back
Top Bottom