How to refer to a form combo-box in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo-box in an Access2000 form to select the occupation of a
contact. The

occupations table is linked on its first column to the master table and only
the description

column is visible in the form.

I want to include this description in a report initiated from a button on
the form. I can

reference standard fields using [Forms]![thisform]![fieldname] but I cannot
seem to be able

to reference the second combo-box column, despite the fact that it is
visible!!

Please help out!!! And, yes, I am new to Access coding!!!
 
DoctorG said:
I have a combo-box in an Access2000 form to select the occupation of a
contact. The

occupations table is linked on its first column to the master table
and only the description

column is visible in the form.

I want to include this description in a report initiated from a
button on the form. I can

reference standard fields using [Forms]![thisform]![fieldname] but I
cannot seem to be able

to reference the second combo-box column, despite the fact that it is
visible!!

Please help out!!! And, yes, I am new to Access coding!!!

You keep posting the same question. Are you having trouble getting the
webnews interface to admit that it has been successfully posted?
 
Actually, yes. I posted the question 3 times requesting to be notified for
replies and I kept getting an error which would be sent to some support
staff. I got an OK the fourth time, when I tried unchecking the notification
box. Needless to say that the first time I hadn't kept a copy of my question
and had to write it all over again!

Dirk Goldgar said:
DoctorG said:
I have a combo-box in an Access2000 form to select the occupation of a
contact. The

occupations table is linked on its first column to the master table
and only the description

column is visible in the form.

I want to include this description in a report initiated from a
button on the form. I can

reference standard fields using [Forms]![thisform]![fieldname] but I
cannot seem to be able

to reference the second combo-box column, despite the fact that it is
visible!!

Please help out!!! And, yes, I am new to Access coding!!!

You keep posting the same question. Are you having trouble getting the
webnews interface to admit that it has been successfully posted?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
DoctorG said:
Actually, yes. I posted the question 3 times requesting to be
notified for replies and I kept getting an error which would be sent
to some support staff. I got an OK the fourth time, when I tried
unchecking the notification box. Needless to say that the first time
I hadn't kept a copy of my question and had to write it all over
again!

That seems to happen far too frequently, and is yet another reason to
use a newsreader program such as Outlook Express or Agent instead of the
web news. I've answered one of your original posts. I'll copy my reply
here, in case you can't find it under the original:

----- quoted reply -----
The best way to solve the larger problem, IMO, would be to include the
linked tables in the report's recordsource query, appropriately joined
to the master table, and include the descriptions in th query's field
list. That would eliminate any need to refer to the controls on the
form at all.

However, if you really need to refer to the second column of a combo box
on a form, you can use a controlsource expression like this for a text
box on your report:

=[Forms]![Entryform]![controlname].[Column](1)

Note that, for these purposes, the columns are numbered from 0, not 1,
so .Column(1) is the second column.

----- end quoted reply -----
 
Back
Top