none
Problems with a VBA Userform using Multipage (2) and DTPicker. RRS feed

  • Question

  •  

    Hi

    Problems with a VBA Userform using Multipage (2) and DTPicker (4)

    On Page1 I've got 2 DTPicker, one for the date and the second for the time.

    Same thing on Page 2.

    Problem:

    Only one set will work, if I close the Userform with" MultiPage"on page2, only that set will work.

    Same thing if I close on Page 1 then just the set on Page 1 will work.

    As anyone seen this problem and any work around you may think would help.

    I'm using Windows 7 , Ms Office Pro. 2003

    same problem on Windows Vista , XL2003


    Cimjet

    Saturday, April 11, 2015 1:52 AM

Answers

  • There are a number of issues relating to the way that date pickers are handled, but the most important is that their output is text. In order to get the values into Excel, you need to format the Excel columns as Date and Custom (time format) and convert the output to the worksheet from text to date values.

    Date pickers also display a few anomalies on multi-page forms, so you need a belt and braces approach. Personally I would put the code to call the form and enter the values in a standard module (as now in the example) and use a belt and braces approach to maintaining the format.

    I think you will find the example now works.

    Revised Example


    Graham Mayor - Word MVP
    www.gmayor.com


    • Edited by Graham MayorMVP Sunday, April 12, 2015 6:07 AM
    • Marked as answer by Cimjet Sunday, April 12, 2015 1:10 PM
    Sunday, April 12, 2015 6:03 AM

All replies

  • If you want to send me a copy of the Word Template or Excel Workbook that contains the UserForm, I will investigate the issue.

    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org

    Saturday, April 11, 2015 6:44 AM
  • Hi Doug

    Have a look at the sample file at the link below.

    http://dropcanvas.com/0rpng

    I had to do a sample file, I can't post the real one, it's not mine, I'm helping a friend.

    I'm also retired, so thanks for having a look at it.

    Regards

    John


    Cimjet

    Saturday, April 11, 2015 12:53 PM
  • There are a number of issues relating to the way that date pickers are handled, but the most important is that their output is text. In order to get the values into Excel, you need to format the Excel columns as Date and Custom (time format) and convert the output to the worksheet from text to date values.

    Date pickers also display a few anomalies on multi-page forms, so you need a belt and braces approach. Personally I would put the code to call the form and enter the values in a standard module (as now in the example) and use a belt and braces approach to maintaining the format.

    I think you will find the example now works.

    Revised Example


    Graham Mayor - Word MVP
    www.gmayor.com


    • Edited by Graham MayorMVP Sunday, April 12, 2015 6:07 AM
    • Marked as answer by Cimjet Sunday, April 12, 2015 1:10 PM
    Sunday, April 12, 2015 6:03 AM
  • Thank you very much Graham

    I had a chance to look at your script and I see what you're doing.

    Fantastic, I wasn't sure if it was a bug,, my computer because I just reinstalled a new hard drive with Windows7 64 Bit running Office2003 or Me not knowing what I'm doing.

    It's my first time using Multipage and It's great learning new things.

    Thanks again

    John


    Cimjet

    Sunday, April 12, 2015 1:48 PM