Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114

    Specific Preview Reporting

    Hello everyone,

    Hope everyone is having a good new year!

    Anyway, i have this problem with my database.

    my database is about searching an item using an unbound searchbox. whenever a user search for an item (key-in the keyterm in the searchbox), the listbox below the searchbox will enumerate or show the records from the keyterms that the users key-in. now, my question is, how to create a specific preview reporting with the searched keyterm used ONLY and not the whole records?

    Example:

    i will search Nokia phones then the listbox will show the records of all Nokia phones --- Nokia 6610, Nokia 3210, Nokia Lumia, Nokia E71, etc. Then i will click a preview report button to show me the Nokia phones only not included Samsung phones, Sony phones, or Blackberry phones (which are in the records also).




    i used this code in the preview report button on the OnClick Event Property:

    Private Sub Preview_Report_Search_Click()
    On Error GoTo Err_Preview_Report_Search_Click
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "QRY_subreport"
    DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
    Exit_Preview_Report_Search_Click:
    Exit Sub
    Err_Preview_Report_Search_Click:
    MsgBox Err.Description
    Resume Exit_Preview_Report_Search_Click

    End Sub


    BUT, that code will show me everything (Samsung, Sony, Nokia, Blackberry, etc.) and NOT Nokia phones only.

    I hope someone can help me. if someone from here experienced this kind of problem, please share it to me the solution so i can move to my next task.

    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Should have brand and model in separate fields. Then can have a list or combo box that has brand names (Nokia, Samsung, Blackberry) as choices and apply filter to brand field. It might be simple to split this data in a query. Are all brands one-word names? Is Nokia the only brand that has the model included in the value?
    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. #3
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    Quote Originally Posted by June7 View Post
    Should have brand and model in separate fields. Then can have a list or combo box that has brand names (Nokia, Samsung, Blackberry) as choices and apply filter to brand field. It might be simple to split this data in a query. Are all brands one-word names? Is Nokia the only brand that has the model included in the value?
    hello June7,

    at first, i tried combobox for this one. everything works fine. BUT, they wanted the database to be in a search function box and not combobox in searching/filtering an item.

    so combobox here is not present instead its a search function box - an unbound textbox that whenever a user enter a keyterm/keyword it will filter and will show records according to the keyterm/keyword.

    the search function box is working FINE (though i have some problems with it but planning to discuss in other thread) BUT my main concern here is the preview reporting how to separate or be more specific in report preview for the searched keyterm/keyword. when a user click the report preview button, it SHOULD only show the items that are being searched not the whole records.

    and yes, they are in a separate fields. and every brand has models included.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    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.

  5. #5
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    yes this will help if my search database is about combobox. but how can i create the same as this for a search function box?

    but okay i will try in the queries placing criteria --- Like [|Forms]![Main].[MyCategory] & "*"

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The LIKE and wildcard should work with that just as well. Could be:

    LIKE "*" & [Forms]![Main].[MyCategory] & "*"
    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.

  7. #7
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    i tried but its not working... should i focus more on the OnClick Event Property? is my code correct?

  8. #8
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    oh by the way, i have that code already (LIKE and wildcard) in my query for the searchbox. this is what i have:

    Like "*" & [forms]![FRM_SearchMulti]![SrchText] & "*" <----- FRM_SearchMulti is the name of Form, SrchText is the name of the searchbox.....

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I know the LIKE and wildcard technique works. Don't know why fails for you. Don't know how code in the click event would matter. If you want more help, provide db for analysis. Follow instructions at bottom of my post.
    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.

  10. #10
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    theres a lot of confidential data in my DBS and the file is kinda big.... will try to create a sample dbs so i can provide it to you.

  11. #11
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    can i post a link here instead since this problem is the same with what is in the link?

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    A link to the database file? Yes.
    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.

  13. #13
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    actually its a link from other forum. im asking permission because maybe it is not allowed here. if its fine, below is the link, but if its not allowed, just delete the link and i will understand:

    http://www.access-programmers.co.uk/...93&postcount=3

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I have that file and it works. This does not help to analyze what is wrong with your db.
    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.

  15. #15
    gatsby is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    114
    thanks for checking the dbs.

    okay, try to search for Italy (its countryname)... the listbox will show you the list of wines from Italy. it says 28 records found; and 316 is the entire records (including Australia, France, and other countries)... now, click the Preview Report Current Results, this button SHOULD only preview the entire wines from Italy since the keyterm is "Italy" only, it should not show or preview the entire wines or entire records from the dbs. that is my difficulty now, how to show only wines from Italy and NOT showing the other records since "Italy" is the keyterm/keyword being used.

    on the other hand, the Preview Report Current Wine is working fine, it only show 1 record.

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

Similar Threads

  1. Help with reporting
    By stevo7624 in forum Access
    Replies: 1
    Last Post: 09-03-2012, 09:54 PM
  2. Replies: 1
    Last Post: 06-15-2012, 05:51 PM
  3. reporting
    By jaykappy in forum Reports
    Replies: 10
    Last Post: 02-16-2012, 03:02 PM
  4. Complex reporting (well for me anyway)
    By Rubijon in forum Reports
    Replies: 4
    Last Post: 11-09-2011, 08:01 PM
  5. Query reporting help
    By kwooten in forum Queries
    Replies: 5
    Last Post: 06-10-2011, 07:03 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