Increase Height of Textboxes in a Form: Need a Function to Loop through Fields (1 Viewer)

PraizesLiberato

Registered User.
Local time
Today, 18:06
Joined
Dec 6, 2009
Messages
69
Private Sub RelationshipHistoryArt_DblClick(Cancel As Integer)
If counter = 0 Then
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height * 2
DateofArt.Height = DateofArt.Height * 2
Me.Detail.Height = Me.Detail.Height * 2
counter = counter + 1
ElseIf counter = 1 Then
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height * 1.5
DateofArt.Height = DateofArt.Height * 1.5
Me.Detail.Height = Me.Detail.Height * 1.5
counter = counter + 1
ElseIf counter = 2 Then
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height * 1.5
DateofArt.Height = DateofArt.Height * 1.5
Me.Detail.Height = Me.Detail.Height * 1.5
counter = 3
Else
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height / 4.5
DateofArt.Height = DateofArt.Height / 4.5
Me.Detail.Height = Me.Detail.Height / 9
counter = 0
End If
End Sub

I need to turn this into a function that can make my input textboxes in my continuous form to resize without Typing in the name of the Textboxes each time.

Or Something that searches for a control with the Keyword input and Loops through till all the Key worded names are expanded.
 

PraizesLiberato

Registered User.
Local time
Today, 18:06
Joined
Dec 6, 2009
Messages
69
Private Sub RelationshipHistoryArt_DblClick(Cancel As Integer)
If counter = 0 Then
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height * 2
DateofArt.Height = DateofArt.Height * 2
Me.Detail.Height = Me.Detail.Height * 2
counter = counter + 1
ElseIf counter = 1 Then
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height * 1.5
DateofArt.Height = DateofArt.Height * 1.5
Me.Detail.Height = Me.Detail.Height * 1.5
counter = counter + 1
ElseIf counter = 2 Then
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height * 1.5
DateofArt.Height = DateofArt.Height * 1.5
Me.Detail.Height = Me.Detail.Height * 1.5
counter = 3
Else
RelationshipHistoryArt.Height = RelationshipHistoryArt.Height / 4.5
DateofArt.Height = DateofArt.Height / 4.5
Me.Detail.Height = Me.Detail.Height / 9
counter = 0
End If
End Sub

I need to turn this into a function that can make my input textboxes in my continuous form to resize without Typing in the name of the Textboxes each time.

Or Something that searches for a control with the Keyword input and Loops through till all the Key worded names are expanded.

This code already works but I will be using several different forms and this may come in handy.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:06
Joined
May 7, 2009
Messages
19,230
why are you making them bigger? to highlight?
there is a Conditional Format where you can Highlight (change color) of the field where your keyword is found.


Private Sub Command50_Click()
Dim objFC As FormatCondition
Dim ctl As Control
For Each ctl In Me.Detail.Controls
ctl.FormatConditions.Delete
Set objFC = ctl.FormatConditions.Add(acExpression, acEqual, _
"Instr([" & ctl.Name & "]," & Chr(34) & Me.Text51 & Chr(34) & ")")
objFC.BackColor = vbYellow
Next

End Sub
 

Users who are viewing this thread

Top Bottom