|
-
Jan 1st, 2012, 06:36 PM
#1
Thread Starter
Member
[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.
Last edited by castellano; Jan 5th, 2012 at 06:09 PM.
Reason: add suggestion
-
Jan 2nd, 2012, 12:21 AM
#2
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.
.
-
Jan 2nd, 2012, 02:24 AM
#3
Thread Starter
Member
Re: Invalid Property Value
Was a error of the maskedit control property not sure where.
Last edited by castellano; Jan 2nd, 2012 at 05:54 PM.
-
Jan 2nd, 2012, 05:49 PM
#4
Thread Starter
Member
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.
Last edited by castellano; Jan 2nd, 2012 at 06:22 PM.
Reason: problem change..
-
Jan 2nd, 2012, 09:09 PM
#5
Member
Re: Invalid Property Value
-
Jan 5th, 2012, 06:19 PM
#6
Thread Starter
Member
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.
Last edited by castellano; Jan 5th, 2012 at 06:20 PM.
Reason: i thinking change to a new post..
-
Jan 5th, 2012, 09:04 PM
#7
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
-
Jan 10th, 2012, 04:20 AM
#8
Member
Re: Invalid Property Value
try calling "mascarapone" on your form activation
-
Jan 10th, 2012, 04:31 PM
#9
Thread Starter
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|