+ Reply to Thread
Results 1 to 5 of 5

I Can't get SHOWDATAFORM and sendkeys to work together?

  1. #1
    Registered User
    Join Date
    09-03-2014
    Location
    Ladera Ranch, CA
    MS-Off Ver
    2010
    Posts
    3

    Angry I Can't get SHOWDATAFORM and sendkeys to work together?

    Can Anyone help me with this?

    I am trying to use showdataform and sendkeys to conduct the following operation:

    1. open the dataform
    2. Press Alt-C to set the criteria
    3. Press Alt-U to enter a name in fourth field
    4. Automatically enter text "gentry" as a variable, mylastname, pulled from another sheet
    5. Press Alt-N to find next

    Here is my code I am using that doesnt seem to work:

    Sub EnterGradesWith_Startingdata()
    Dim mylastname
    mylastname = Worksheets("studentdata").Cells(2, 4).Value
    Sheets("data").ShowDataForm
    SendKeys "%C"
    SendKeys "%U" & mylastname & "%N"
    End Sub

  2. #2
    Registered User
    Join Date
    09-03-2014
    Location
    Ladera Ranch, CA
    MS-Off Ver
    2010
    Posts
    3

    Re: I Can't get SHOWDATAFORM and sendkeys to work together?

    I have also tried:

    Sub EnterGradesWith_Startingdata()

    Dim mylastname
    mylastname = Worksheets("studentdata").Cells(2, 4).Value

    'Sheets("data").ShowDataForm

    Sheets("data").Activate
    Range("a1").Activate
    ActiveSheet.ShowDataForm
    With ActiveSheet.dataform
    SendKeys "%C"
    SendKeys "%U" & mylastname & "%N"
    End With

    End Sub

    ...................and can't get this to work either?

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: I Can't get SHOWDATAFORM and sendkeys to work together?

    The Sendkeys commands have to be before the Showdataform call:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    09-03-2014
    Location
    Ladera Ranch, CA
    MS-Off Ver
    2010
    Posts
    3

    Re: I Can't get SHOWDATAFORM and sendkeys to work together?

    Awesome!!! I thought I was going crazy! THANK YOU!

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: I Can't get SHOWDATAFORM and sendkeys to work together?

    Glad to help.

    Please remember to mark the thread solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] why doesn't SendKeys work consistently?
    By crimsonkng in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2022, 12:58 AM
  2. Sendkeys doesn't work on my laptop with Vista
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-26-2010, 07:24 PM
  3. Showdataform
    By Arak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2007, 09:45 AM
  4. Why doesn't "Sendkeys" work reliably for me?
    By Cloudfall in forum Excel General
    Replies: 2
    Last Post: 09-26-2005, 02:05 AM
  5. Application.SendKeys won't work with Remote Desktop????
    By WildIrish in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2005, 11:06 AM

Tags for this Thread

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