Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2005
    Posts
    144

    Red face Unanswered: Query to open filtered results

    Hello Experts,

    I have a form with a subform attached to it. In that subform I have a field called MemoNotes (Field Type memo). I have a dblclick event set on that field which opens up a query with that field, so I can see the field completely. In subform I am limited on space.

    What I would like is to be able to open that query filtered with that record only, but right now it opens up results of all records.

    I hope i am making sense here.

    Thanks

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I would open a separate form (that uses the query as the data source) then when open the form use the Where parameter in the DoCmd.OpenForm to filter it to the one specific record.

    A couple of things:
    1. I would open the form using acDialog so that the only thing the user can do is edit the memo.
    2. You will also want to add a Requery to your subform after the DoCmd.OpenForm so that it shows the user changes.
    3. Finally, for the form with just the memo field in it, if you are only allowing one memo to be edited at a time I would set the Cycle property to Current Record so that the user cannot add a memo field.

  3. #3
    Join Date
    Jul 2005
    Posts
    144

    Unhappy Didnt explain enough

    Thanks for your prompt reply DCkunkle,
    I should have explained my situation a little better. I have a main form with subform attach to it. On main form i have name and address fields and on my subform along with other fields i have a memo field for long notes. Since my form cant stretch too far so i have decided to put a dblclick event on the memo field so when you double click it should open memo field in either form or a query so i can read all of the notes.

    I hope i am making some sense here this time.....
    I am attaching my database here please have a look at the form and tell me what do you think.

    Thanks again
    Attached Files Attached Files

  4. #4
    Join Date
    Sep 2006
    Posts
    265
    Dialog box is your answer. I use this to view an image but the same princile applies: Heres some code, does test for a record

    With CodeContextObject
    If IsNumeric(.[MemoNoteID]) Then
    DoCmd.OpenForm "MemoNotesDialog", acNormal, "", "[MemoNoteID] = " & .[MemoNoteID], , acNormal
    End If
    End With

    End Function

  5. #5
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I believe you explained it well enough. I have modified your database to show you what I was talking about. Take a look...
    Attached Files Attached Files

  6. #6
    Join Date
    Jul 2005
    Posts
    144
    Thanks alot SimonMT and DCKunkle,
    It works great.

Posting Permissions

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