Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Apr 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using .htm page to open report in Access (Access 2003)

    OK...

    I'm attempting to create a web page to take the place of a form in a database called 'Subs' in MS Access. Reason being that there are people here in the office that will need a report generated by the form, but don't have Access on their computers. The form is a list of checkboxes, and the user may select one or many of them. What checkboxes are checked determines what reports are pulled. Below is the code in the MS Access form that runs the report:

    If Me.chkUtilities = True Then
    strWhere = strWhere & ", " & Chr(34) & "Utilities" & Chr(34)
    End If

    If Me.chkWalls = True Then
    strWhere = strWhere & ", " & Chr(34) & "Walls" & Chr(34)
    End If

    ****** This series of If....End If's repeats for each of the other check boxes ******

    Then...the part that pulls the report:

    strWhere = "SubType In (" & Mid(strWhere, 3) & ")"
    DoCmd.OpenReport ReportName:="rptSubcontractors", WhereCondition:=strWhere

    I've been able to re-create the if...then chain with JavaScript in the .htm file:

    if (z.chkAsp.checked) {
    qryStr = (qryStr + ' ' + 'Asphalt'); }
    if (z.chkBol.checked) {
    qryStr = (qryStr + ' ' + 'Bollards'); }

    *****************etc, etc, etc***************

    I wonder how I would go about sending my .htm form information into Access and generating this report.

    Something with the Submit button's onClick perhaps?

    As always, any help is sincerely appreciated!!!

    B. Drake

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

    Re: Using .htm page to open report in Access (Access 2003)

    Unfortunately Internet Explorer doesn't have the capability of automating Access, so printing an Access report from a web page isn't very likely to ever work. VB Script (or Java Script) cannot use the object model exposed by Office applications in general. (Think of the mischief hackers could wreak if web pages could do that.) So whatever you create as a report to print has to be done in the web browser, which is a serious limitation. There are some options if you choose to use Data Access Pages - but they have pretty serious limitations too. To be fairly general you either have to resort to ASP or ASP.net. Sorry to be the bearer of bad news.
    Wendell

  3. #3
    Star Lounger
    Join Date
    Apr 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using .htm page to open report in Access (Access 2003)

    Wendell,

    Thanks for the tip! I actually was starting to get the feeling that it might not be possible either. However, fortunately the software I'm using to create the site also supports .asp pages. So, having said that, do you know how I could go about accomplishing this task?

    Much obliged!

    B. Drake

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

    Re: Using .htm page to open report in Access (Access 2003)

    Sorry for the delay in responding - I was traveling out of state most of last week. ASP pages are a relatively complex topic that requires most people to buy a book and study it for a while (at least it did me). It also typically requires knowing ADO in order to manipulate a dataset. As an alternative, you might try FrontPage - I understand that it can create ASP pages for simple display and editing requirements. You might want to make a post in the FrontPage forum and see if someone there can help you if you choose that route.
    Wendell

  5. #5
    Star Lounger
    Join Date
    Apr 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using .htm page to open report in Access (Access 2003)

    Thanks!

    I actually figured out what I needed to do, and so far everything works great. My page can now access the correct table in the database, and pull a query based on form elements from the web page. Sure enough, .aspx (VB) was the answer.
    "Web Database Development" by Jim Buyens is a great book, and all the database examples in it use Access.

    Appreciate the help!

    B. Drake

Posting Permissions

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