Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refer to the shown collumn of a combo and not to the hidden one

Status
Not open for further replies.

Davide77

Technical User
Mar 6, 2003
166
0
0
CH
hallo,
in a form I have a combobox with two collums: ID and cost. The recordsorce of the combo is the ID. In the query I make it show the cost related to that ID. The ID collumn is hidden. In the same form I calculate a total and so I need to refer the value shown in the combo, but using the combo name automatically refers to the ID. HOw to do it?
 
Columns in combo boxes are numbered from 0. The zero column is shown by default. To refer to the second column use

comboName.Column(1)


HTH

Rich

Bespoke and off-the-shelf Access solutions
 
Hallo RichD,

the problem is that I have a continuos form, and I would like to have a control that shows a different amount depending on the hidden collumn of the combo. In the case you told me the control would display the same amount form all the rows of the continuos form depending on the combo value of the selected row....
any ideas?
 
[tt]
I think that the columns are numbered from zero (0) when using VBA code. When referring to the column in the Data Page of the property sheet, "Bound Column", the numbering begins from 1.

But Davide, surely you could be a little more clear about what you need to accomplish. And is the ID column hidden as a result of not being included in the query? Or is it hidden by being assigned a zero inch (0") length in the Format page of the property sheet? If the ID is not in the query, then it's not going to be available in the form for calculation.

Cheers,[/tt]

[glasses][tt]Gus Brunston - Access2000(DAO)
Skill level based on 1-10: 7, on the way to 6, and beyond!
Webmaster: www.rentdex.com[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top