Displaying selected record in a Textbox

KevinAnderson

New member
Local time
Today, 13:47
Joined
Feb 2, 2010
Messages
9
I have a form that lets you select an employee name from a combobox. When you select the employee name a subform populates in a datasheet view with the Name, record ID, and the last column contains a description of the record. As a datasheet view is not good for reading these messages i want to display the message of the selected record in a larger text box. any ideas on how this could be done?


Thanks
 
Change the subform from datasheet view to continous form view.
 
It needs to remail in a a datasheet view. Any other options.
 
Create a text box in your main form and set its control source property to the Description field. Something like this.

=Me.SubformName.Form.Controls("NameOfDescriptionField").value

Or

=Me.SubformName.Form![NameOfDescriptionField]

I believe either should work
 
Will this code update the textbox when i Highlight a different record in my subform?
 
Actually neither of those would work, as "Me" is invalid outside VBA. This should work:

=[SubformControlName].[Form]![NameOfDescriptionField]
 
That expression can go in the control source box? Doesnt seem to be working for me.

thanks for the continued help
 
What is the error? Does it display anything?

And you're right about it being Control Source. Anything you paste into the text box in design view makes it its control source. Can you paste your code her.
 
You're probably using the wrong name(s). Paste your line of code here.
 
Use the Build feature while in the textbox control source and navigate to the appropriate control on the subform. That should ensure you get the right names. The usual issue is that you need the name of the subform control, not the name of the subform itself, if they're different.
 

Users who are viewing this thread

Back
Top Bottom