Results 1 to 13 of 13
  1. #1
    amerhendy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    6

    help : error2101

    my form is for search
    i have 2 option (sader , wared)
    there is subform called result
    there is 2 queries called "fr_wa , fr_sa"
    when i choose wared , there is error appeared called "run time error '2101'"
    and too when i choose sader
    the code is :


    Code:
    Private Sub wared_GotFocus()
    [creators_text].Visible = True
    [a1].Visible = True
    creators_text.Caption = "converts"
    [from_text].Visible = True
    [a2].Visible = True
    from_text.Caption = "convert to"
    sader1_text.Caption = "convert result"
    result.SourceObject = "fr_wa"
    End Sub

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    What happens if you comment out the following?
    result.SourceObject = "fr_wa"

  3. #3
    amerhendy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    6
    Quote Originally Posted by ItsMe View Post
    What happens if you comment out the following?
    result.SourceObject = "fr_wa"
    the same error

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The only other thing I can imagine is you are changing a property that can not happen on the Got focus. The only other one that stands out is

    from_text.Caption = "convert to"

    If, when the error occurs, you choose to debug, what line of code gets highlighted? you may need to use a different event handler.

  5. #5
    amerhendy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    6
    really thank you
    i make form instead of the query
    it done
    thank you
    but i dont know why i show the records twice in the query or in the form ( it is only one in the table)????

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Does the query include several tables? Do they have a 1-to-many relationship?

    Post the sql statement of the query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    amerhendy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    6
    SELECT wared.w_id, wared.w_came, wared.w_topic, wared.w_goto_creators, wared.w_goto_creators_copy.Value, wared.w_files.FileData
    FROM wared;

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    If two records show in the form then there must be two records in table wared.

    Why do you want to change Source Object?

    If you want to provide db, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    amerhendy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    6
    Quote Originally Posted by June7 View Post
    If two records show in the form then there must be two records in table wared.

    Why do you want to change Source Object?

    If you want to provide db, follow instructions at bottom of my post.
    thanks you
    but there is 6 records in table wared ..... but in the form its 12 records
    i want to change object because i need search form with 2 tables and 4 choice
    thanks you

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Sorry, that doesn't help me understand the issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    amerhendy is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    6
    If two records show in the form then there must be two records in table wared.
    there is 6 records in the table ... the query form show 12 records

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I still can't figure out what is happening. Will have to view table, query, form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    if you are using a query, it sounds like you added them to the query window but failed to join them correctly. giving multiple results for each table list.

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

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