Results 1 to 9 of 9

Thread: [RESOLVED] Invalid Property Value

  1. #1

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    56

    Resolved [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

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    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.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    56

    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.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    56

    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..

  5. #5
    Member cb_liwanag's Avatar
    Join Date
    Nov 2011
    Location
    Philippines
    Posts
    33

    Re: Invalid Property Value

    try "yy/MM/dd"

  6. #6

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    56

    Unhappy 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..

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    Member cb_liwanag's Avatar
    Join Date
    Nov 2011
    Location
    Philippines
    Posts
    33

    Re: Invalid Property Value

    try calling "mascarapone" on your form activation

  9. #9

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    56

    Resolved 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
  •  



Click Here to Expand Forum to Full Width