Request or show value of text box in form from another form?

siamandm
5StarLounger
Posts: 1192
Joined: 01 May 2016, 09:58

Request or show value of text box in form from another form?

Post by siamandm »

Hello all,
If i want to show the value of text box from frm1 to be shown in frm2 in text box2
1- if form 1 still opened
2- if form 1 is closed

How this possible and what are the issues which may rase ?

Regards

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Re: Request or show value of text box in form from another form?

Post by burrina »

If CurrentProject.AllForms("frmsomeformnamehere").IsLoaded Then
somecontrolnamehere = Forms!frmsomeformnamehere!somecontrolname
End If

User avatar
HansV
Administrator
Posts: 78237
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Request or show value of text box in form from another form?

Post by HansV »

When a form is closed, its text boxes don't have a value, so you'll have to use code such as suggested by Burrina to populate the text box on frm2 while frm1 is open.
Best wishes,
Hans

siamandm
5StarLounger
Posts: 1192
Joined: 01 May 2016, 09:58

Re: Request or show value of text box in form from another form?

Post by siamandm »

Thanks alot for you all