+ Reply to Thread
Results 1 to 8 of 8

Invalid property value.

  1. #1
    Don Wiss
    Guest

    Invalid property value.

    I have a multipage form in xl2002. After adding some code it has been
    giving me an error message if I run a line of code that sets the focus (in
    an input error routine). I then get the exact equivalent of:

    MsgBox "Invalid property value.", vbExclamation, "Microsoft Forms"

    This MsgBox then pops up twice if I try to change tabs, which it then won't
    let me do. Or it pops up once if I try to close the form with a cancel,
    which it also then won't let me do. I can close the form with the X in the
    upper right, but then after the form closes I get this MsgBox.

    The line of code with the SetFocus was copied from elsewhere. What is
    different on these lines is I am setting the focus on a combo box with a
    value that is no longer in the RowSource range. If I comment out the
    SetFocus line, run the error code, and set the focus there manually, I have
    no problems. The combo box has match required.

    I can, of course, not have the program set the focus and let the user
    figure out which input has the error. Or I could clear the wrong input.
    Neither is ideal. Any other suggestions?

    Don <www.donwiss.com> (e-mail link at home page bottom).

  2. #2
    Tom Ogilvy
    Guest

    Re: Invalid property value.

    Since only values in the list are valid, why not alter the properties to
    make it a dropdown - the user must select from the list. Then if you set a
    default value, there is no validation required.

    --
    Regards,
    Tom Ogilvy

    "Don Wiss" <donwiss@no_spam.com> wrote in message
    news:g2kbc1996dma1rh7enjf9lr5v387soil48@4ax.com...
    > I have a multipage form in xl2002. After adding some code it has been
    > giving me an error message if I run a line of code that sets the focus (in
    > an input error routine). I then get the exact equivalent of:
    >
    > MsgBox "Invalid property value.", vbExclamation, "Microsoft Forms"
    >
    > This MsgBox then pops up twice if I try to change tabs, which it then

    won't
    > let me do. Or it pops up once if I try to close the form with a cancel,
    > which it also then won't let me do. I can close the form with the X in the
    > upper right, but then after the form closes I get this MsgBox.
    >
    > The line of code with the SetFocus was copied from elsewhere. What is
    > different on these lines is I am setting the focus on a combo box with a
    > value that is no longer in the RowSource range. If I comment out the
    > SetFocus line, run the error code, and set the focus there manually, I

    have
    > no problems. The combo box has match required.
    >
    > I can, of course, not have the program set the focus and let the user
    > figure out which input has the error. Or I could clear the wrong input.
    > Neither is ideal. Any other suggestions?
    >
    > Don <www.donwiss.com> (e-mail link at home page bottom).




  3. #3
    Don Wiss
    Guest

    Re: Invalid property value.

    On Fri, 1 Jul 2005 22:04:00 -0400, "Tom Ogilvy" <twogilvy@msn.com> wrote:

    >Don Wiss wrote:
    >> I have a multipage form in xl2002. After adding some code it has been
    >> giving me an error message if I run a line of code that sets the focus (in
    >> an input error routine). I then get the exact equivalent of:
    >>
    >> MsgBox "Invalid property value.", vbExclamation, "Microsoft Forms"
    >>
    >> This MsgBox then pops up twice if I try to change tabs, which it then won't
    >> let me do. Or it pops up once if I try to close the form with a cancel,
    >> which it also then won't let me do. I can close the form with the X in the
    >> upper right, but then after the form closes I get this MsgBox.
    >>
    >> The line of code with the SetFocus was copied from elsewhere. What is
    >> different on these lines is I am setting the focus on a combo box with a
    >> value that is no longer in the RowSource range. If I comment out the
    >> SetFocus line, run the error code, and set the focus there manually, I have
    >> no problems. The combo box has match required.
    >>
    >> I can, of course, not have the program set the focus and let the user
    >> figure out which input has the error. Or I could clear the wrong input.
    >> Neither is ideal. Any other suggestions?


    >Since only values in the list are valid, why not alter the properties to
    >make it a dropdown - the user must select from the list. Then if you set a
    >default value, there is no validation required.


    You've lost me Tom. The situation is the choices on the combo box depend on
    a checkbox on the first tab. It is possible that someone checks that box.
    Then makes a combo box selection that is only for when checked. Then they
    uncheck the box. Now the combo box selection is no longer valid. And it is
    no longer a choice on the combo box. I have to edit for such a situation.
    The Match = True won't help me here.

    Don <www.donwiss.com> (e-mail link at home page bottom).

  4. #4
    Registered User
    Join Date
    05-31-2005
    Location
    Brooklyn, NY
    Posts
    5

    Invalid Property Value

    Don,

    I get the same exact error message from my form. I don't know how to debug it either because it appears before any line of code can be stepped-through (F8). I don't have the Multi-page like you, but mine is a single page form that has one drop-down (and some buttons, etc ) which I use with an OnChange routine.

    When I manually clear the item in the drop-down using the back-space key, it clears the control. But the error pops up each and every time I close the dialog box with the "x" top right or cancel button. Seems that it doesn't like something but when I put a stop in the userform terminate the error occurs before the stop. So I can't figure out how to isolate the code in question. Really, I'm not sure what code is running at all when the form is closed.

    When the control is not clear but has data, NO ERROR message.

    Did you figure out your problem yet? Could your solution perhaps help me with my problem?

    Michael

  5. #5
    Don Wiss
    Guest

    Re: Invalid property value.

    Excelente <Excelente.1s4uod_1121299594.4053@excelforum-nospam.com> wrote:

    >Did you figure out your problem yet? Could your solution perhaps help
    >me with my problem?


    I threw in the towel. I simply no longer do the SetFocus on the combobox
    with the wrong value. In my error message I tell them which layer has the
    error.

    I did dust off this past week a form I developed some years back. We now
    have the database it needs to be useful. In playing with it I got an
    Invalid property value! In this case the value was blank. This as I changed
    the first combobox, and the lists for the subsequent ones changed. Along
    with changing the first I cleared all the subsequent ones (and changed
    their lists). A blank entry I gather isn't a match=true entry. I haven't
    yet investigated this "new" form to see if I can do something about it.

    Don <www.donwiss.com> (e-mail link at home page bottom).

  6. #6
    Registered User
    Join Date
    05-31-2005
    Location
    Brooklyn, NY
    Posts
    5

    Cool

    Quote Originally Posted by Don Wiss
    A blank entry I gather isn't a match=true entry. I haven't
    yet investigated this "new" form to see if I can do something about it.
    Thank you very much for responding. I believe what you are now experiencing is similar to what I am in that a blank value is not allowed for some reason. If I figure something out I'll post my findings. Hope you will do the same.
    Michael
    Excelente

  7. #7
    Don Wiss
    Guest

    Re: Invalid property value.

    Excelente <Excelente.1s60ag_1121353647.5621@excelforum-nospam.com> wrote:

    >Don Wiss Wrote:
    >>
    >> A blank entry I gather isn't a match=true entry. I haven't
    >> yet investigated this "new" form to see if I can do something about
    >> it.

    >
    >Thank you very much for responding. I believe what you are now
    >experiencing is similar to what I am in that a blank value is not
    >allowed for some reason. If I figure something out I'll post my
    >findings. Hope you will do the same.


    I will post, or e-mail, but it could be a month from now. I have endless
    programming projects, so I'm not sure when I'll get to that one.

    Don <www.donwiss.com> (e-mail link at home page bottom).

  8. #8
    Don Wiss
    Guest

    Re: Invalid property value.

    Excelente <Excelente.1s60ag_1121353647.5621@excelforum-nospam.com> wrote:

    >Don Wiss Wrote:
    >>
    >> A blank entry I gather isn't a match=true entry. I haven't
    >> yet investigated this "new" form to see if I can do something about
    >> it.

    >
    >Thank you very much for responding. I believe what you are now
    >experiencing is similar to what I am in that a blank value is not
    >allowed for some reason. If I figure something out I'll post my
    >findings. Hope you will do the same.


    I spent a couple minutes looking at some code I wrote a few years ago that
    dealt with the match errors. I grabbed two chunks of code which I leave to
    you to try to figure out. You will see that I was changing the
    MatchRequired property back and forth. In these two macros the ClassGroup
    combo is before the Class. What is displayed in Class depends on which
    ClassGroup is chosen. And above ClassGroup is line of business, which each
    have different ClassGroups. It is likely that I could use these to solve
    the problem I started this thread about.

    Private Sub cbClass_Enter()
    cbClass.MatchRequired = True
    End Sub

    Private Sub cbClassGroup_Change()
    ' this is the macro running flag
    ' [probably better to use Application.EnableEvents=True/False]
    If MRFlag = True Then Exit Sub

    ' populate the Class combo box
    If IsNull(cbClassGroup.Value) Or cbClassGroup.Value = "" Then
    Exit Sub
    End If

    ' we clear the ILF code, as they may be switching Sublines
    cbILF.Value = ""
    lbExpBase.Caption = ""
    txtBLC.Value = ""

    ' here we call the SQL, and then either we display an error or
    ' write data to combo box
    Call Get_Data(statecls_GL1, sql, True)
    If ErrFlg = 1 Then Exit Sub
    cbClass.Clear
    cbClass.MatchRequired = False
    cbClass.List = data
    txtClassCode.Value = ""

    End Sub


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1