Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    3

    Question Unanswered: Filter on current record in a form using a check box

    I have a database that has a checkbox to indicate that the record is complete and no longer active.

    When I click the check box I would like it to filter on the ID number to limit to that record and then output this to an email that will be sent to selected members that the actions are complete.

    In the afterupdate property I have tried a where statement in a macro but I must be doing it wrong as I still outputs all the records.

    I hope I have expainted it ok, any help would be appreciated

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Post the code you've been toying with please
    P.S. you can (read should) convert your macros into VBA code by right clicking them and chosing Save As... Module
    George
    Home | Blog

  3. #3
    Join Date
    Feb 2008
    Posts
    3
    Hi

    This is the code thats in the after update,

    I don't know why but it brings up a find box

    Private Sub Action_Complete_Click()
    Me.[REA Number].SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
    DoCmd.SendObject acForm, "REA", "MicrosoftExcelBiff8(*.xls)", "", "", "", "REA Update", "The attached REA has been completed and is now closed. Any queries please raise with relevent department.", True, ""

    End Sub

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    So, here's where we resort to good old fashioned debugging...

    Comment out each line in turn and run the code; this should allow you to tell us which of the 3 lines are causing the problem and we can proceed from there
    George
    Home | Blog

  5. #5
    Join Date
    Feb 2008
    Posts
    3
    Hi, thanks for all your help, I managed to get it fixed. My code now reads the following code and works a treat.

    On Error GoTo Ger_REA_Number_for_report_Err

    DoCmd.OpenReport "REA Report", acViewPreview, "", "[REA Number]=[Forms]![REA]![REA Number]", acHidden
    DoCmd.SendObject acReport, "REA Report", "RichTextFormat(*.rtf)", "", "", "", "REA Completion", "The attached REA has been completed, please review. Any issues please contact relevent department", False, ""


    Ger_REA_Number_for_report_Exit:
    Exit Function

    Ger_REA_Number_for_report_Err:
    MsgBox Error$
    Resume Ger_REA_Number_for_report_Exit

Posting Permissions

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