Mario R. Perez
New member
- Local time
- Today, 08:59
- Joined
- May 14, 2020
- Messages
- 12
Hi All, could you help me where is my mistake.
1: In the form call to a Class
Option Compare Database
Dim textmayusculas As ClassTextos
Private Sub Form_Load()
set textmayusculas = New ClassTextos
Set textmayusculas.Movimiento = Me
end sub
2: class: ClassTextos
Option Compare Database
Private WithEvents Letracapital As Access.TextBox
Dim mcol As Collection
Public Property Set Movimiento(ByRef FRM As Form)
Dim ctl As Control
For Each ctl In FRM.Controls
Select Case ctl.Name
Case "FldName", "FldAddress", "FlsRep"
Set Letracapital = ctl
Letracapital.AfterUpdate = "[Event Procedure]"
mcol.Add Letracapital, ctl.Name
Set Letracapital = Nothing
End Select
Next ctl
End Property
Private Sub Letracapital_AfterUpdate()
'On Error Resume Next
Letracapital.value = StrConv(Letracapital.Text, vbProperCase)
End Sub
When I run it, only the "FldName" textbox is executed, the other "FldAddress", "FlsRep", are not executed.
thanks for advance
1: In the form call to a Class
Option Compare Database
Dim textmayusculas As ClassTextos
Private Sub Form_Load()
set textmayusculas = New ClassTextos
Set textmayusculas.Movimiento = Me
end sub
2: class: ClassTextos
Option Compare Database
Private WithEvents Letracapital As Access.TextBox
Dim mcol As Collection
Public Property Set Movimiento(ByRef FRM As Form)
Dim ctl As Control
For Each ctl In FRM.Controls
Select Case ctl.Name
Case "FldName", "FldAddress", "FlsRep"
Set Letracapital = ctl
Letracapital.AfterUpdate = "[Event Procedure]"
mcol.Add Letracapital, ctl.Name
Set Letracapital = Nothing
End Select
Next ctl
End Property
Private Sub Letracapital_AfterUpdate()
'On Error Resume Next
Letracapital.value = StrConv(Letracapital.Text, vbProperCase)
End Sub
When I run it, only the "FldName" textbox is executed, the other "FldAddress", "FlsRep", are not executed.
thanks for advance