Results 1 to 4 of 4
  1. #1
    Grek is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    39

    Question access 2010 macro & open form

    Hello,

    I'm trying to open a new form via double-click on a cell of a sub-form.

    I want the form that is opened via the double click to display the record of the line that I double-clicked.

    It works fine with this code:

    Code:
     
    Private Sub ID_DblClick(Cancel As Integer)
    DoCmd.OpenForm "F_New_Non_Hedged_Share_Class", , , "[ID] = " & Me!ID
    End Sub
    However, since i'm trying not too much vba code, i'd like to setup that kind of thing via access 2010 macro.

    So I have:
    Open Form
    Form Name: F_New_Non_Hedged_Share_Class


    View: Form
    Filtername:
    Where condition:
    Data Mode:
    Windows Mode: Normal

    Question: I'm assuming that I need to update the "where condition", but what should I put? I tried different things, ie. [ID]=[ID], etc - but without success

    fyi: the dbl click is not on the ID field of the sub-form but an other field. I'm assuming this doesn't change anything?

    Thanks,

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried ("[ID] = " & Me!ID) just as you had in the code?

  3. #3
    Grek is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    39
    Hi
    Just tried. Got a msg box saying "Enter Paramater Value 'Me!ID'"

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm not knowledgeable with macros but how about:
    "[ID] = " & Me.ID
    ...using a dot (.) instead of a bang (!)

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

Similar Threads

  1. Access 2010 first macro - errors
    By DLParker in forum Forms
    Replies: 9
    Last Post: 10-16-2011, 04:17 PM
  2. Access 2010 Macro Help
    By RayMilhon in forum Access
    Replies: 3
    Last Post: 09-30-2011, 12:03 PM
  3. Access 2010 Macro
    By RayMilhon in forum Access
    Replies: 3
    Last Post: 09-28-2011, 11:37 AM
  4. Form / Macro Question
    By kilosierra71 in forum Access
    Replies: 5
    Last Post: 07-26-2011, 10:13 AM
  5. Replies: 0
    Last Post: 07-13-2010, 07:45 AM

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