Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    james28 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    92

    Quote Originally Posted by June7 View Post
    Report can be filtered by making the RecordSource a dynamic parameterized query or by passing the filter criteria in WHERE CONDITION argument of OpenReport method.
    June,

    Thank you for the reply. While I think I sort of see what you mean, I have no idea how to do that. Do you happen to have an example or a slightly more step by step version?


    Thank you again!

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I have no idea what filter criteria you want but here is simple example of OpenReport:

    DoCmd.OpenReport "report name here", , , "ID=" & Me.ID

    Most often the code is in button Click event.

    Access VBA Help has more info on OpenReport (and OpenForm) arguments.

    Here is a tutorial for parameterized query as report RecordSource http://www.datapigtechnologies.com/f...mtoreport.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    james28 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    92
    June,

    Thank you again! It looks like that did the trick. I am going to do a bit more fiddling around, but I think all is well now.



  4. #19
    james28 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    92
    June,

    Due to a change in the functionality, I am trying to make a small change, but I can not seem to get it to work.

    ComboboxOptions
    ComboboxSubOption1
    ComboboxSubOption2

    There are 3 options in the ComboboxOptions: All, Dog, and Cat. The change is in senario 3.
    Senario 1: When ComboboxOptions = All, ComboboxSubOption1 and ComboboxSubOption2 are hidden.
    Senario 2: When ComboboxOptions = Cat, ComboboxSubOption1 is visible and ComboboxSubOption2 is hidden.
    Senario 3: When ComboboxOptions = Dog, ComboboxSubOption1 and ComboboxSubOption2 are both visible.

    I tried to add "and", "&" and "or" in various places, but I get the error that it will not validate or that it is expecting something else in the expression.

    With the following code, I was able to make senario 1 and 3 work, but senario 2 has both combo boxes hidden.

    Private Sub ComboboxOptions_AfterUpdate()
    Me.ComboboxSubOption1.Visible = Me.ComboboxOptions = "Cat"
    Me.ComboboxSubOption2.Visible = Me.ComboboxOptions = "Dog"
    Me.ComboboxSubOption1.Visible = Me.ComboboxOptions = "Dog"
    End Sub

    Do you have any idea how to make it work as desired?

    Thank you!

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Try:
    Me.ComboboxSubOption1.Visible = (Me.ComboboxOptions = "Cat" Or Me.ComboboxOptions = "Dog")
    Me.ComboboxSubOption2.Visible = Me.ComboboxOptions = "Dog"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #21
    james28 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    92
    June,

    Thank you!!!!!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-25-2013, 02:08 PM
  2. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  3. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 PM

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