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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms![myForm]!dynamictextboxName 2

Status
Not open for further replies.

lanelouna

Programmer
Dec 19, 2002
71
GB
hello everybody
I h ave a question please, which i managed to resolve
but i am looking for a better coding
i want to simply say this

If p = RS!SCOD Then
nameOfCr = p & "_CR_" & code
defautCrC = Forms![myForm]!nameOfCr

however i had to do it this way, since it doesn t recognize nameOfCr in : defautCrC = Forms![myForm]!nameOfCr


If p = RS!SCOD Then
nameOfCr = p & "_CR_" & code
For Each ctl In frm.Controls
If ctl.ControlType = acTextBox Then
If ctl.Name = nameOfCr Then
defautCrC = ctl.Value
Exit For
End If
End If
Next ctl


is there a way to do it?
thank you
Lina
 
Change the Access notation to VB notation:

defautCrC = Forms("myForm")(nameOfCr)

That's all...

Good luck
[pipe]
Daniel Vlas
Systems Consultant
 
Hi Lina!

You can do it like this:

defautCrC = Forms![myForm].Controls(nameOfCr)

hth
Jeff Bridgham
bridgham@purdue.edu
 
thank you both
I apreciate it alot
that would save me lots of time
Regards

Lina Chebli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top