Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Arkansas, USA
    Posts
    163
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SubForm Problem (Access XP)

    Is there a way to double click on a record in a Subform and open a particular form displaying the record that was double clicked on? I use the following code in the double click event to accomplish this in a list box:

    DoCmd.OpenForm "frmOrder", acNormal, , "[tblOrders].[Order_ID]=" & Str(Me![list], which is the name of the subform on the form, frmMain, but I get an error stating that

    Microsoft Access cannot find the field 'SubSearch' referred to in your expression.

    I tried to substitute SubSearch.Order_ID and subformOrders.Order_ID as well and get similar errors.

    Is this even possible, or will I have to use a list box in order to get this effect. I am using an unbound subform on the form which fills with a particular Datasheet based on one of five command buttons.

    Thanks in advance for any assistance.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: SubForm Problem (Access XP)

    You have to use the name of the control on the subform, not the subform control. From the way you phrased it, I can't tell if the code is running behind the parent form or the subform, but in either case, you have to reference the control name that contains the OrderID on the subform. Can you fill in the blanks please? What kind of control are you referencing and on what dblclick event?
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Arkansas, USA
    Posts
    163
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SubForm Problem (Access XP)

    Thanks. I checked the subform and provided a unique field name for the field that needed to be referenced and inserted this new field name, txtsubOrder_ID into the place of [list] and it worked.

    THanks for the assistance.

Posting Permissions

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