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!

Click on SubForm record and populate text box

Status
Not open for further replies.

marm2000

Technical User
Jul 7, 2011
3
0
0
GB
Hi,

I have a subform with contact entries. I'd like to be able to click on one company (1st column) and populate a text box "Company Selected".

How can I do this?

Thanks very much for any info.

Best
 
ON the click event of the (text box) control that is the company you are clicking, you would assign the value it has to company selected...


I'm not sure where company selected is. You'll need to know the names of the controls.


Assuming the control that is the company is named txtCompany and you are entering the value into txtCompanySelected on the same form your code on the click event would be...


Code:
Me!txtCompanySelected = Me!txtCompany
 
Hi Lameid, thanks for the help so far.

Doesn't work yet. I uploaded my database if you want to have a look at...

There is a Form called "Contacts", where a subform ("QueryChooseCompanyFromSubForm subform1") is located with a few contact entries. I would like to be able to click on a company name (column "Company" of the form) and have the clicked name copied to the textbox Text29.

Thanks very much for looking at my problem..
 
 http://www.mediafire.com/?bzvtvzimn3nqbvd
How are ya marm2000 . . .

In the [blue]On Click[/blue] event of [blue]Company[/blue] copy/paste one of the following code lines ...

If [blue]Text29[/blue] is on the same subform:
Code:
[blue]Me.Text29 = Me.Company[/blue]
If [blue]Text29[/blue] is on the parent form:
Code:
[blue]Me.Parent.Text29 = Me.Company[/blue]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top