Results 1 to 4 of 4
  1. #1
    giladweil is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    10

    Reference to a query from a form does not work


    Hello,

    I created an automatic pop-up form that appears when opening the database, and in it a button that refers to a query.
    When I click the button appears the message -



    "The expression On Click you entered as the event property setting producted the followinng error: Ambiguous name detected: YourButton_Click"

    The query itself works well without the referral from the button on the form.

    The VB file:

    Private Sub Command2_Click ()
    On Error GoTo Err_Command2_Click

    Dim stDocName As String

    stDocName = "LayersAll"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

    Exit_Command2_Click:
    Exit Sub

    Err_Command2_Click:
    MsgBox Err.Description
    Resume Exit_Command2_Click

    End Sub

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Dim strDocName As String
    strDocName = "Query3"
    DoCmd.OpenQuery strDocName, acViewNormal, acEdit

    I think it will be acViewNormal

  3. #3
    giladweil is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    10
    Thanks,
    It still does not work. The Syntax should be fine - he worked in the past. It stopped working as soon as I transferred the file from my computer to a server, even after refreshing the links.
    The queries themselves work fine - the connection with the form does not work.

  4. #4
    giladweil is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    10
    anyone? help?

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

Similar Threads

  1. Control Reference on a Form
    By gmitchell@exbrief.com in forum Forms
    Replies: 5
    Last Post: 01-24-2011, 12:31 PM
  2. form/subform reference problem
    By dbertanjoli in forum Forms
    Replies: 1
    Last Post: 01-10-2011, 03:31 PM
  3. Variable within form control reference
    By Tyork in forum Programming
    Replies: 2
    Last Post: 10-13-2010, 09:55 AM
  4. Reference to a Query
    By starhannes in forum Forms
    Replies: 5
    Last Post: 05-09-2010, 02:53 PM
  5. Form Name Reference in VBA
    By Simon Sweet in forum Programming
    Replies: 0
    Last Post: 05-22-2008, 01:55 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