Display column in combobox in new form

Kila

Registered User.
Local time
Today, 15:44
Joined
Mar 5, 2003
Messages
275
I have a similar problem to the post here. I have a form that enters information on patient admissions and discharges. At the bottom of the form is a button that opens a survey so that a staff member can take information from a phone survey. I want the survey to display information from the admission/discharge form in unbound boxes, just to remind the staff member which patient and admission they are working with. The original admission/discharge form stores information into a table using ID numbers from combo boxes. So the combobox displays (from column 2 or 3) the patient movement action (admission, discharge, transfer, etc.), but what is STORED is the ID number of that action.

If I put the following in the form for the survey:
=[Forms]![frmTraineeInfo]![sfrActions]![cboDepartmentID],

It will sucessfully display the ID number from the admission/discharge form, but I cannot get it to display the text instead. I have tried to use the suggestion from the referenced post, to add the column:
=[Forms]![frmTraineeInfo]![sfrActions]![cboDepartmentID].Column(3)

but the system automatically displays
=[Forms]![frmTraineeInfo]![sfrActions]![cboDepartmentID].[Column](3) (column is now bracketed) in the properties box, and will NOT display the text associated with the ID number.

I would appreciate any suggestions. I am sure that I am missing something very simple. Thanks so much for your assistance.
 
A few things:

1. Remember that the combo box columns are ZERO-BASED, so if you want the third column you want to reference column 2.

2. It looks like, from your examples of what you've tried, that you are referencing a subform on the main form. To do so requires a slightly different syntax. In fact you have to reference the subform CONTAINER Name(the control that houses the subform on the mainform) and not the subform name (although if they are the same that is okay).

3. You have to use the word FORM after the subform container name.

So,

=[MySubformCONTAINERName]![Form]![YourComboBox].Column(2)

More about subform syntax here: http://www.btabdevelopment.com/main...rhowtoreferencesubforms/tabid/76/Default.aspx
 
Got It! Thanks!

Actually, when you told me that the columns were zero-based, I tried changing the number from 2 to 1. I figured if that didn't work, then I would try your container reference. THAT did it. Thanks! I KNEW it was something very simple I was missing!

This one worked:
=[Forms]![frmTraineeInfo]![sfrActions]![cboDepartmentID].[Column](1)
 

Users who are viewing this thread

Back
Top Bottom