The subject line might suggest my question is simple but, it's part of a work around I have had to do!
I want a Text Box value to be equal to the first Row and only column of a List Box.
Why I want to do this is because I need to format the value to STANDARD but a List Box does no allow this.
Here is the CODE I've tried which worked fine until I wanted to create a new record. When the form changed to Add Mode my text box TEXT1 is equal to the value of the List Box in the previous record.
CODE SAMPLE # 2
Any ideas!
James ;-)
I want a Text Box value to be equal to the first Row and only column of a List Box.
Why I want to do this is because I need to format the value to STANDARD but a List Box does no allow this.
Here is the CODE I've tried which worked fine until I wanted to create a new record. When the form changed to Add Mode my text box TEXT1 is equal to the value of the List Box in the previous record.
Code:
Text39 = Max(Me!List37)
Dim intCounter As Integer
Dim bolMoved As Boolean
Dim strTextBox As String
bolMoved = False
For intCounter = 1 To 1
strTextBox = "Text" & Format(intCounter)
If Nz(Len(Me.Controls(strTextBox).Value), 0) = 0 Then
Me.Controls(strTextBox).Value = Me!List37.Value
bolMoved = True
Exit For
End If
Next intCounter
If bolMoved = False Then
Call MsgBox("All the text boxes are full")
End If
CODE SAMPLE # 2
Code:
If Me.Text1.Visible = False Then
Me.Text1.Visible = True
Me.Text1.Value = Me!List37.Value
End If
Any ideas!
James ;-)