Results 1 to 7 of 7
  1. #1
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34

    Having a hard time programmatically making reports

    I can barely find answers in google or MSDN.



    I'm trying to find a tutorial, or at least some sample code on how to programmatically create a report.

    What I have now is a Form that opens up with the Access database with drop down menus that allows people to use my own interface to customize a report, because the users of this database don't want to learn access.

    So for example:


    There is a combobox that allows you to select what kind of filter to use on a pre-existing report (say you want to only see certain records).

    Then you click a button that loads the report and it has been changed according to what the user selected in the combobox.


    I appreciate any help.

  2. #2
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    So what have you got so far and where is it failing.

  3. #3
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34
    I've got the form designed with all the controls.
    When I click the buttons it can load a report.

    I've written code in Visual Studio (VB.NET) to interact with database tables, sure.
    But manipulating reports is something I've NEVER done... so as far as code I have nothing. I wish copying and pasting procedures from my past VB programs into ACCESS would work... but I learned that's wishful thinking.
    Last edited by blacksaibot; 01-20-2010 at 07:06 AM. Reason: A

  4. #4
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Try using the query Grid to obtain the result you want.

    There are some wizards there that should point you in the right direction.

    Then base your report on the query.

    You can move onto more advanced stuff later.

    Check the Northwind Database for examples.

  5. #5
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34
    I can't even get a simple button to execute my event procedure!!
    on the OnClick event I tell it to change the caption of a label to something else, and it doesn't even do THAT!

    Code:
    private sub commandbutton_click()
    label32.caption = "Whatever"
    end sub
    Even tried this.... nothing
    Code:
    Me.label32.caption = "Whatever"
    Forms![FormName]![label32].Caption = "Whatever"
    Is that not correct code?!?!

  6. #6
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    private sub commandbutton_click()
    me.label32.caption = "Whatever"
    end sub

    This should work.

    Do you have Event Procedure on the Click Event in the properties box for that Command Button.

  7. #7
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34
    Quote Originally Posted by Rainlover View Post
    private sub commandbutton_click()
    me.label32.caption = "Whatever"
    end sub

    This should work.

    Do you have Event Procedure on the Click Event in the properties box for that Command Button.
    Thanks i got it to work... for some reason the database file i was working in got corrupted or configured wrong. I used the same code in a new file and all my procedures work.

    wEIRD

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Programmatically add a field to an existing table
    By lpdds in forum Database Design
    Replies: 2
    Last Post: 11-10-2009, 12:45 PM
  2. Change Row Background Color Programmatically
    By sales@4bco.com in forum Programming
    Replies: 2
    Last Post: 10-25-2009, 11:17 AM
  3. Hard Returns v. Squares
    By Goodge12 in forum Queries
    Replies: 3
    Last Post: 01-28-2009, 10:10 AM
  4. Simple but hard question
    By andymok in forum Reports
    Replies: 1
    Last Post: 09-20-2007, 09:19 AM
  5. Replies: 11
    Last Post: 03-16-2006, 12:28 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