[RESOLVED] Invalid Property Value
I'm trying to finish this program that use a text file to store data, but the problem here is a error 380 invalid property value. I think the problem is about the maskedit control. I use this control to let the user enter the date, and before send to the textfile a invisible textbox is used to format the input in the maskedit control.
The error is pointing to this part of the code:
Me.Maskfechadeefectividad.Text =Me.txtFechadeEfectividad.Text
Code:
Sub LeerRecord(QuePosicion As Integer)
Dim empleado As EmpleadoTipo
If QuePosicion > 0 Then
Open App.Path + "\DatosEmpleados.txt" For Random As #2 Len = Len(empleado)
Get #2, QuePosicion, empleado
Close #2
nuevomaximo
mascarapone
Me.txtSeguroSocial.Text = empleado.SeguroSocial
Me.txtTransaccion.Text = empleado.Transaccion
Me.txtLlaveGenerica.Text = empleado.LlaveGenerica
Me.txtOperador.Text = empleado.Operador
Me.txtTerminal.Text = empleado.Terminal
Me.txtFechadeEntrada.Text = empleado.FechadeEntrada
Me.txtHoradeEntrada.Text = empleado.HoradeEntrada
Me.cmbanotrimestral.Text = empleado.numerodetrimestre
Me.txtCodigo.Text = empleado.Codigo
Me.txtFechadeEfectividad.Text = empleado.FechadeEfectividad
Me.Maskfechadeefectividad.Text =Me.txtFechadeEfectividad.Text
Me.Maskfechadeentrada.Text = Me.txtFechadeEntrada.Text
Me.Maskhoradeentrada.Text = Me.txtHoradeEntrada.Text
End If
End Sub
Function mascarapone()
Me.Maskfechadeefectividad.Format = "yy/mm/dd"
Me.Maskfechadeefectividad.Mask = "##/##/##"
Me.Maskfechadeentrada.Format = "yy/mm/dd"
Me.Maskfechadeentrada.Mask = "##/##/##"
Me.Maskhoradeentrada.Format = "hh:mm:ss"
Me.Maskhoradeentrada.Mask = "##:##:##"
End Function
I will appreciate any help or suggestion and can give more info if is needed.
Re: Invalid Property Value
Can you tell us what is the value of the Me.txtFechadeEfectividad.Text property when the code executes? There's a possibility this value conflicts with the MaskedEdit control's format property.
.
Re: Invalid Property Value
Was a error of the maskedit control property not sure where.
Re: Invalid Property Value
Is working now, but i have trouble with the format and mask, the code that I use:
Code:
Function mascarapone()
Me.Maskfechadeefectividad.Format = "yy/mm/dd"
Me.Maskfechadeefectividad.Mask = "##/##/##"
Me.Maskfechadeentrada.Format = "yy/mm/dd"
Me.Maskfechadeentrada.Mask = "##/##/##"
Me.Maskhoradeentrada.Format = "hh:mm:ss"
Me.Maskhoradeentrada.Mask = "##:##:##"
End Function
If I put this 11/04/30 in the maskedit control
is automatic changed to 30/04/11
I need use the mascarapone function only.
Any help or suggestion will be very aprecciate.
Re: Invalid Property Value
Re: Invalid Property Value
Using yy/MM/dd:
When i put 11/12/23 and press the "tab key" the mask edit control change to 23/11/12."I click" the maskedit control again and change to 11/12/23.
i need maintain the mask edit control with the first input when I click tab.
Re: Invalid Property Value
if it's a date, why not use the datepicker control instead... set the format to "Custom" then set the customformat to what ever you want...
-tg
Re: Invalid Property Value
try calling "mascarapone" on your form activation
Re: Invalid Property Value
Adding yy in the original "yy/MM/dd" the format for the mask is working, but i need use a specific format in the text file. I realize that is not functional use the Mid function I decided to use the date picker with this code:
Code:
Function mascaraquita()
txtFechadeEntrada.Text = Format(Me.Maskfechadeentrada.Value, "yyMMdd")
Me.txtFechadeEfectividad.Text = Format(Me.Maskfechadeefectividad.Value, "yyMMdd")
mascarahora = Format(Me.txtHoradeEntrada.Text, "######")
Private Sub Form_Load()
Me.Maskfechadeefectividad.CustomFormat = "yy/MM/dd"
Me.Maskfechadeentrada.CustomFormat = "yy/MM/dd"
Thanks for the help:)