Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    NumLock (Access97)

    I am running the following Sub:
    -----------------------------------------------------
    Private Sub Ctl10_Click()

    CalControl.Value = Format(CalControl.Value, "Short Date")

    DoCmd.runmacro "Pick a Date"
    Me!Activities.SetFocus

    End Sub
    -----------------------------------------------------
    Everytime it executes, NumLock is turned off. How can I prevent this? Thanks in advance!

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: NumLock (Access97)

    I'm guessing that you "Pick a Date" macro contains the Sendkeys command. If so, this will toggle the NumLock. This is a known bug that has no fix. You can get around it sometimes by trying to send an even number of characters. Best way is not to use SendKeys.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NumLock (Access97)

    Appreciate the information. Thanks!

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NumLock (Access97)

    I've unsuccesfully looked for, and experimented with several solutions to my problem. Being that nothing seems to work, could you advise how could I make a command button in the form turn NUMLOCK on? Thanks in advance for any asistance!

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: NumLock (Access97)

    You want to put a button the the form to toggle the numlock? Why not just have user use keyboard key?

    Have you determined that SendKeys is the cause of your problem? What are you doing that requires SendKeys?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NumLock (Access97)

    Yes, I am using SendKeys and have no doubt that's my problem! I created a data entry form where the user clicks a button; a date field is updated with the current date, and then the focus jumps to the end of a memo field. The memo field has entries for previous dates. What I want to do is, once the focus is at the end of the memo field, I want the program to execute two "carriage returns", enter the current date plus a hyphen. Any help appreciated!

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: NumLock (Access97)

    You will have to do this with code, but it is simple. The code would be:

    txtSomeDate = Date( ) ' This sets that date field to today
    txtMemo = txtMemo & vbCrLf & vbCrLf & Date( ) & "-"

    Note: vbCrLf is an intrinsic constant for CarriageReturn/LineFeed.

    You really just need to avoid SendKeys completely.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  8. #8
    DaveShmave
    Guest

    Re: NumLock (Access97)

    Roberto,

    Try this: <A target="_blank" HREF=http://www.mvps.org/access/api/api0046.htm>http://www.mvps.org/access/api/api0046.htm</A>

    It has code that will allow you to use "SendKeys" but doesn't disable your NumLock. Now the light might toggle off, however, the key pad still works correctly. Try it!

    If it wasn't for this code, I'd agree with Mark and avoid SendKeys all together.

    HTH

    Dave

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NumLock (Access97)

    Thanks! Will work it out.

  10. #10
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NumLock (Access97)

    Appreciate the info. Thanks!

Posting Permissions

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