Results 1 to 11 of 11

Thread: search (2k)

  1. #1
    New Lounger
    Join Date
    Mar 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    search (2k)

    i found this MDB at the net , it is very usufeul & nice i try to put abuttom for report preview to show the fealds that i choose but i can't , cna any help me to do that .
    ashraf
    Attached Files Attached Files

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search (2k)

    If you have a report object that you want to preview, the easiest way is to create a button that previews the report when clicked by using the Command Button Wizard. In the form's design view, click the Command Button icon on the toolbox. If the Control Wizard is turned on (make sure the Control Wizard button is selected on the toolbar), screens will display to lead you through the process. Choose Report Operations and Preview Report.

    I didn't look at the attached Db, but if this isn't helpful post back.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: search (2k)

    The database came from The Access Web. What are you trying to preview? You can already see the results of the query in the results box, so what is it that you're trying to do?
    Charlotte

  4. #4
    New Lounger
    Join Date
    Mar 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search (2k)

    Thanks for all
    I want to build a report depobds of the results of the query & when i do a preview for a report it changes acording to the results of the query. I Hope to explan good .
    Ashraf

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: search (2k)

    How are you planning to build the report? You could certainnly capture the SQL from the form to use as the recordsource for a report, but that is only one part of building a report. What have you done so far? Do you have any code built to generate the report?
    Charlotte

  6. #6
    New Lounger
    Join Date
    Mar 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search (2k)

    I try to do like u said but how the fealds will apear ?
    ashraf

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: search (2k)

    Explain what you've tried so far. We can't answer questions without adequate information about what you tried.
    Charlotte

  8. #8
    New Lounger
    Join Date
    Mar 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search (2k)

    Dear Charlotte ,
    u can consider that iam not do any thing & i ask from u to help me to put a reopt preview buttom on that from . if u can or not really iam thank u for ur help.
    Ashraf

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: search (2k)

    You have to create a report before you can have a button to preview it. The code to do that from the on-the-fly query form would not be simple and would require the use of VBA code. Maybe someone else has built something like that and would be willing to share. I will ask the MVPs in the Lounge if they know of anything like that.
    Charlotte

  10. #10
    New Lounger
    Join Date
    Mar 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search (2k)

    Thank U dear .
    Ashraf

  11. #11
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: search (2k)

    I think our problem is that we don't understand enough about what you are trying to do.

    It would also help if we knew how much you have worked with Access. If you know how to write VBA code, putting a button, that you can click to preview a report, on a form is fairly easy. In fact, even if you do not know VBA, the wizard, as suggested by ThomasW will do it for you. The more complex part is to pass a parameter to the data source for the report.

    One way we have done it is to make the report data source a query with criteria that reference a control on the form. That way the user can type criteria into the control, then click the Report Preview button, and the report will display the desired data. In that case, the criteria looks like:
    [/i]<font color=448800>Forms![MyForm]![MyComboBox]</font color=448800>[/i]
    where MyComboBox refers to a drop-down combo box used to select a particular critera.

    The first step of course is to design your report. I should also tell you that the sample database you found isn't of great value in doing this kind of thing. The most common way to dynamically change the SQL data source of a report is to open it in design mode, set the property and then switch it to Preview. There are a number of complexities in trying to do that however, and other techniques are even more difficult.

    I hope this helps - if you can tell us more details about the data you are trying to work with it would also be easier for us to give you help.
    Wendell

Posting Permissions

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