Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Posts
    9

    Unanswered: Problem with form click event

    Hi ,

    I am having a problem with an access form. Wherever on the form I click it prompts you to execute a query which should only be executed when a button is clicked on the same form .
    I haven`t got any events set in code behind for the form itself , still when I click anywhere on it it attempts to run the query.
    Here is the code behind the form:

    Private Sub Form_Current()

    End Sub

    Private Sub Form_DataChange(ByVal Reason As Long)

    End Sub

    Private Sub Form_DataSetChange()

    End Sub

    Private Sub Form_Dirty(Cancel As Integer)

    End Sub

    Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)

    End Sub


    If anyone has clue what might have gone wrong , would really be appreciated.

    Thanks
    Milena

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Try deleting and recreating the button?
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    In the form Design View, select the form itself then goto Properties - Events and see if there's anything in the On Click property. Select the Detail Section and do the same thing for it. The name of a query that requires a parameter placed in either of these places will also produce the behavior you're citing.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Jan 2009
    Posts
    9

    Cool

    Hi and thank you all for help.
    I checked the events under detail sector on the form and it turned out I have set a macro(executing the query that was giving headeache) under onclick property. I removed that event and now the form is ok.

    Thanks again

    Milena

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad you got it fixed!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •