Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Choosing a file (2003)

    I have a form "CUST_Name" that has a command button that opens a query. The query has a field Called "Cust Name", Which I would like to double click on, and open the record that coresponds to the choice, in the origional form. How does one go about that? See the code I have tried. It does nothing. HELP!!

    Private Sub Cust_Name_DblClick(Cancel As Integer)
    ' Get out if no Cust_Name Test Code
    If IsNull(Me.Cust_Name) Then
    Exit Sub
    End If

    ' Save record if necessary
    If Me.Dirty Then
    RunCommand acCmdSaveRecord
    End If

    ' Open form
    DoCmd.OpenForm FormName:="FRM_Customers", WhereCondition:="[Cust_Name]=" & Chr(34) & Me.Cust_Name & Chr(34)

    End Sub

  2. #2
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Choosing a file (2003)

    If I understand you correctly, you want to click on the query result and a query is not an object you can click on. That only works on forms.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Choosing a file (2003)

    Like Zave, I'm confused about what you're doing. Queries don't have code, so where did you put this code? If you mean that you want to be able to double click on Cust_Name in the form also named Cust_Name, put a breakpoint on the first line (click in the line and press F9). When you open the form and double click Cust_Name, the code should pause at the first line of the event procedure. Press F8 to single step through the code. Hopefully this provides a clue why nothing happens.

Posting Permissions

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