none
UserForms and Task selection (VBA Project) RRS feed

  • Question

  • Hi,

    I have 2 UserForms : 

    UserForm1 can run with or without any selected task

    UserForm2 needs a selected task.

    If I run UserForm1  without any task selected, UserForm2, which does not run, thrown an error and blocks UserForm1.

    How can I tell UserForm2 to keep quiet while the others UserForms are running?

    Thanks

    Thursday, October 6, 2016 9:30 PM

All replies

  • WLID1966,

    A little more context please. How are the userforms called? How do the two userforms interact? Give us a short description of what the userforms do.

    There's just not enough information to give you a good answer.

    John

    Friday, October 7, 2016 1:50 AM
  • Sub BadWeather() This UserForm1, triggered by a click on a custom button in the ribbon, plays with a calendar 
    Load UserForm1 and doesn't need any task selection.
    UserForm1.Show
    End Sub

    Sub AdditionalClause() This one is also triggered by a button in the ribbon. It increase the duration of a selected  task
    Load Userform2
    Userform2.Show
    End Sub

    Any idea?

    Thanks

    Friday, October 7, 2016 7:50 AM
  • WLID1966,

    Sorry but that doesn't tell us how they interact. Are they both part of a macro that opens them (i.e. show userform1, ask for a date, close that userform, open userform2, take some action, etc.)? It sounds analogous to a single userform that has a datepicker and then takes some action using the selected date. I know you haven't been able to get the datepicker function working on your system, but is there a reason you have two userforms?

    Or maybe the two userforms are independent, in which case I suspect the issue is in userform2 if you are getting an error.

    Again, not enough information to really give much good help.

    John

    Friday, October 7, 2016 2:10 PM
  • Hi John,

    Theoretically, the 2 UserForm are completely independent and don't interact. I understand it’s not obvious to analyze such a phenomena remotely J

    Thank you for trying to help



    • Edited by WLID1966 Friday, October 7, 2016 2:24 PM
    Friday, October 7, 2016 2:23 PM
  • WLID1966,

    Would be glad to help further but my hands are tied, so to speak, on this one.

    John

    Friday, October 7, 2016 4:29 PM