+ Reply to Thread
Results 1 to 15 of 15

Correct vba code for text boxes in user form

Hybrid View

  1. #1
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Correct vba code for text boxes in user form

    Clare

    Why would you start typing if day in the month or year part of the date picker?

    All you need to do to move back to the day is use ←(left) or →(right).
    If posting code please use code tags, see here.

  2. #2
    Forum Contributor
    Join Date
    05-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007
    Posts
    144

    Re: Correct vba code for text boxes in user form

    Hi Norie,

    Again, thanks. Trying out the DatePicker, I realise that the left and right arrows will enable a user to scroll through the calender.

    However, in paragraph 4 of my Post #4 above, I noted the sort of difficulty any of our users would face - see below:

    Instead of having to scroll through the drop-down calendar for each month and year, I was of the opinion that it would be quicker to just type into the userform date box either 12/4/13 or 20/9/11 or16/7/12 etc, and in each case – after pressing the tab key - the date that will automatically appear in the date text box will be in the format ‘dd/mm/yyyy’, and correctly for each year, without the sort of problem I indicated in my first Post.

    It was with a view to achieving such ‘quickness’ and ease that I sought to use the code in my first Post. I am hoping that there could be an adjustment to my ‘date’ code that would prevent the bugs that I have with it. The code works well for some calendar years but not for all calendar years. Example
    In your first response, you clarified to me that a user could type in a date in the Date box (something I didn't know, and for which I am grateful). I would like to adopt the DatePicker approach, but be able to type in the date given the numerous transactions that one has to put through.

    As you might know, in that kind of situation, the moment a user clicks the 'ADD ENTRY' button, the focus or cursor immediately goes back to the the first entry box which in our case is the DATE box. A user would immediate start typing the date seen on the next invoice - starting with the day, then month and then year.

    The problem that I notice is that when the cursor goes back to the DATE box, the highlight is either on the 'day' or on the 'year'. When a user commences to type in the date of the invoice he/she has in hand, the first thing the user would start keying in would be the 'day' of the said invoice before 'month' before 'year'. And he/she would be doing that with some reasonable speed.

    But because the highlight is either on the 'month' or 'year' section of the next date that shows up on the Date box - the user will realise that what has been typed in as the 'day' of the invoice has been put into either the 'month' or 'year' section of the date showing on the Date box.

    I want to know if there is anything that can be done for the highlight to be on the 'day' section. That would help solve my problem.

    Thank you.

    Kind Regards.

    Clare

+ 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