Assigning a variable to a form object

itmasterw

Registered User.
Local time
Today, 01:17
Joined
Oct 31, 2005
Messages
45
Hi, I ma trying to find away to check is a textbox on a form in null then I want to put a certain value in there. Actually I have about 15 of these text boxes. Therefore I am trying to use a variable and as the for loop go through each one, it checks to see if the box is null, and if it is it will put a certain value is there. The problem that I am having is concatenating the variable to the form object. I have a form called Form1 and two Textboxes called text0 and Text1.
Any ideas I really will appreciate.
Thank you

Here is what I am tring on a simple version of this:

Private Sub Command4_Click()
Dim x As String
Dim Frm1 As Form_Form1
Dim i As Integer

i = 1
x = ""

For i = 1 To 2
x = CStr(x) & i

If IsNull("Me.Text" & x & ".Value") = True Then
Frm1.Text & x & ".Value" = "PP"
End If

Next i

End Sub
 
found an answer to this

I found an answer ot this thank you
In case anyone else could use this this is what I did:
Private Sub Command4_Click()
Dim i As Integer
Dim TX As String

i = 0

For i = 0 To 1

TX = "Text" & i

If IsNull(Form(TX)) Then
Form(TX) = "PP"
End If

Next i

Ed

End Sub:)
 

Users who are viewing this thread

Back
Top Bottom