Results 1 to 5 of 5

Thread: How Do I List Data From Access in Parameter Prompt

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    54

    How Do I List Data From Access in Parameter Prompt

    Hi all..iused VB6,Access and CR8.5.

    I have create one parameter field for Location..May i know how to list out all location that contains in Access DB, in Parameter Prompt so that user can choose it from parameter list..
    Thanks

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How Do I List Data From Access in Parameter Prompt

    Use the parameters collection of your report object in VB.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    54

    Re: How Do I List Data From Access in Parameter Prompt

    Quote Originally Posted by RobDog888
    Use the parameters collection of your report object in VB.
    Thanks a lot..but can u give me an example.What i have done so far:

    VB Code:
    1. Private Sub cmdPrint_Click()
    2. Dim criteria
    3.     Screen.MousePointer = 11
    4.  
    5.    With CrystalReport1
    6.         .ReportFileName = App.Path & "\RPT\RPTLocation.rpt"        
    7.         .DiscardSavedData
    8.         .WindowShowCloseBtn = True
    9.         .WindowShowRefreshBtn = True
    10.         .WindowState = crptMaximized
    11.         .WindowShowSearchBtn = True
    12.         .WindowTitle = "Location "                          
    13.          .Action = 1
    14.     End With
    15.     Screen.MousePointer = 0    
    16. End Sub
    I just create a parameter on CR only.Please let me know how to do it in VB.So it will be listed out all of the location in Paramter Prompt.Thanks

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How Do I List Data From Access in Parameter Prompt

    Create the parameter in CR first.

    View > Field Object. Then on that windows toolbar you click the "Add New" while the appropriate node is sleected. As long as you bring up the Field Object dialog.

    Then your VB code

    VB Code:
    1. CrystalReport1.ParameterFields.Item(1).ClearCurrentValueAndRange
    2. CrystalReport1.ParameterFields.Item(1).AddCurrentValue sTitle
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    54

    Re: How Do I List Data From Access in Parameter Prompt

    Quote Originally Posted by RobDog888
    Create the parameter in CR first.

    View > Field Object. Then on that windows toolbar you click the "Add New" while the appropriate node is sleected. As long as you bring up the Field Object dialog.

    Then your VB code

    VB Code:
    1. CrystalReport1.ParameterFields.Item(1).ClearCurrentValueAndRange
    2. CrystalReport1.ParameterFields.Item(1).AddCurrentValue sTitle
    Thanks a lot..What do u mean by .Item(1).....when i typed crystalreport1.ParameterFields.(After this dot, there is no property list coming).There was something important declaration that i have missed??Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width