Report

Discussion in 'AutoCAD' started by Kumar, Jun 11, 2004.

  1. Kumar

    Kumar Guest

    Hello Everybody,
    Here I am trying to open a report, created in microsoft Access database. It is report created from parametric query and I want to set its (report's parameter) by code.Code used in given below. But I think my syntex is wrong and also could not find relevant code in Access help. If any body can guide me, where i am doing mistake? or does any body have code to open a report created from parametric query from AutoCAD VBA environment ?? Plesae help me i will be thankful.

    access.DoCmd.OpenReport "CityOfficerQuery1", acViewPreview, "CityOfficerQuery", ["Enter ProjectID"].String = UserForm2.CmbBoxReportProjectID.List(UserForm2.CmbBoxReportProjectID.ListIndex)
     
    Kumar, Jun 11, 2004
    #1
  2. Kumar

    Ed Jobe Guest

    I've tried that before too, using a param query. But if you are getting the param from a combo on a form, you don't need the param. Just make the report based on a regular query and build your own query string in the code you posted. Just get rid of the param prompt. Also, as is, your query will fail. You need to concatenate the cbo value with the query string. Tip: make your query do what you want, then in the design window, switch to sql view and copy the code to your macro. Then all you have to do is format it into a string.
     
    Ed Jobe, Jun 11, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.