Results 1 to 5 of 5
  1. #1
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209

    Form_Load Event



    Code:
    Private Sub Form_Load()
        changeSource Me.AccountName, Me
    End Sub
    Account Name is a textbox on my form that is populated manually. I want the source of the form, to change depending on what is input into that text box, but I get this error:

    error
    sub or function not defined


    What did I leave out?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Hi

    What is "changeSource"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    What I am trying to make the code say is "change source" change the recordset of the form to Me.AccountName which is a textbox on my form called AccountName

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Well, you've made up a function that Access has no knowledge of, hence the error. You'd want to change the record source property:

    Me.RecordSource = "QueryNameOrSQL"

    It is unlikely that setting it to the account name textbox would work, unless it contains the name of a table or query in the database.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    OMG!! I have been banging my head against the wall all darn week because of this, I forgot we pulled a backup and the backup didn't have the module in it that called changeSource!

    Thank you!!!!!!!!!!!!!!!!!!!!!!

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

Similar Threads

  1. Help on an event...
    By allykid in forum Forms
    Replies: 4
    Last Post: 03-15-2011, 11:25 AM
  2. Form_Load not being called
    By Buakaw in forum Forms
    Replies: 1
    Last Post: 03-09-2011, 04:46 AM
  3. Form_Current Event
    By Bubi in forum Forms
    Replies: 6
    Last Post: 02-22-2011, 11:16 AM
  4. Form_Load Events
    By TheDeceived in forum Programming
    Replies: 1
    Last Post: 09-20-2010, 12:19 PM
  5. Replies: 21
    Last Post: 06-03-2009, 05:54 PM

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