Results 1 to 3 of 3
  1. #1
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34

    Having trouble dealing with these textboxes

    First I get the error saying "you can't reference a property or method for a control unless..." blah blah blah

    so I used .SetFocus on the textbox.


    Code:
    txt_startdate.setfocus
    str_start = txt_startdate.text
     
    txt_enddate.setfocus
    str_end = txt_startdate.text
    Now it says this error: "Run-time error '424': Object required"

    The debugger highlights txt_enddate.setfocus



    What am I missing here? (Programming in VBA, Acecss 2007)

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you eliminate the ".Text", you will not need to set focus. .Value is the default, and it's what you want anyway.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34
    Quote Originally Posted by pbaldy View Post
    If you eliminate the ".Text", you will not need to set focus. .Value is the default, and it's what you want anyway.
    Still getting the same error.

    Nevermind. I put .value at the end, but took that off too and it works

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Trouble with Query
    By jbarrum in forum Access
    Replies: 1
    Last Post: 01-13-2010, 04:10 PM
  2. subform comboboxes/Textboxes
    By terryvanduzee in forum Forms
    Replies: 2
    Last Post: 11-19-2009, 07:41 PM
  3. Two textboxes connected to the same table
    By ma09fraga in forum Forms
    Replies: 6
    Last Post: 06-11-2009, 12:42 PM
  4. Code Trouble?
    By briancb2004 in forum Access
    Replies: 0
    Last Post: 10-08-2008, 04:47 PM
  5. Get average of unbound textboxes.
    By markhook in forum Forms
    Replies: 8
    Last Post: 07-14-2006, 09:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums