Results 1 to 7 of 7
  1. #1
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178

    Unanswered: ouch-growing pains

    Hi,

    I recently 'upgraded' to A-2007 from XP. Now my reports don't print. Error msg: "The expression On Print you entered as the event property setting produced the following error: A problem occurred while <db name> was communicating with the OLE Server or AciveX Control." These reports existed in XP for many years and worked well.

    I have no problem with printing from either Excel or Word.

    Please help. Thanx,

    Sam

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    Did you checked the references of the project?
    Did you compiled and repaired?
    Do you have several versions of Access installed on the same machine?
    Have a nice day!

  3. #3
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Quote Originally Posted by Sinndho View Post
    Did you checked the references of the project? Yes
    Did you compiled and repaired? Yes
    Do you have several versions of Access installed on the same machine? No
    Thanks,
    Sam

  4. #4
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Here's the entire procedure code. However, I don't think it's the problem: when I set a breakpoint, the run doesn't stop there. It seems that Access never gets to even open the proc/event. the 4 text boxes Text94 thru Text97 are all "Unbound," so I may set the value in VBA. Here goes:

    Code:
    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    
        Dim ArPrayer(4), NextElem As Integer, EndCntr As Integer
        
        NextElem = 1
        
        If Not Me.[מזמור לתודה] Then
            ArPrayer(NextElem) = "מזמור לתודה " + "NO"
            NextElem = NextElem + 1
        End If
        
        If Me.המלך_הקדוש Then
            ArPrayer(NextElem) = "המלך הקדוש"
            NextElem = NextElem + 1
        End If
        
        If Not Me.תחנון Then
            ArPrayer(NextElem) = "תחנון " + "NO"
            NextElem = NextElem + 1
        End If
        
        If Not Me.למנצח Then
            ArPrayer(NextElem) = "למנצח " + "NO"
            NextElem = NextElem + 1
        End If
        
        For EndCntr = NextElem To 4
            ArPrayer(EndCntr) = ""
        Next EndCntr
        
        Me.Text94 = ArPrayer(1)
        Me.Text94.BorderStyle = IIf(Me.Text94 = "", 0, 1)
        
        Me.Text95 = ArPrayer(2)
        Me.Text95.BorderStyle = IIf(Me.Text95 = "", 0, 1)
        
        Me.Text96 = ArPrayer(3)
        Me.Text96.BorderStyle = IIf(Me.Text96 = "", 0, 1)
        
        Me.Text97 = ArPrayer(4)
        Me.Text97.BorderStyle = IIf(Me.Text97 = "", 0, 1)
        
    End Sub
    The gibberish actually shows up as Hebrew characters in the code, but I can't duplicate the Hebrew font on the forum (it's called Arial (Hebrew)). Maybe it (A-07) doesn't like ADO. What do I have to change?

    Thanks for all,
    Sam

  5. #5
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    The first think you can do is to be sure that the Detail_Print event handler procedure is actually called. Set a breakpoint on the first executable line of it (NextElem = 1).
    Have a nice day!

  6. #6
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    I've already gone there. It doesn't stop there. It seems to me that the problem is with the report object itself. There are no 'funny' objects on it, just text boxes, most of which are direct reads from the underlying record source. The 4 unbound ones are set in VBA with the foregoing code. No rocket science.

    I also noticed something else just now. I started to re-code the program. I wanted to set ALL the variables in a table, and remove all unbound t-boxes, reading them all directly from the (changed) record source. However, even when I set it there, I find that there's a fatal problem. Whether it comes to the files' field names (some of which are in Hebrew) or the Hebrew string values I'm assigning in the VBA, Access reads gibberish. I.e., when it comes to field names I get the error msg "Item not in this collection", and the assigned values, while I don't get an error msg, are also gibberish. I put the mouse over the various names and the 'read' is gibberish, not Hebrew, although I set the VBA Editor font as Arial (Hebrew), which actually displays in Hebrew in the VBA. Apparently that's the ONLY place it displays correctly. What now?

    Thanks, Sinndho, for trying to save what little hair I have left,
    Sam

  7. #7
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    YAY!!! I FINALLY FOUND IT! EUREKA!! With the help of the One Above, of course.

    While I had the Hebrew language installed, that's not all that was necessary. I had to open the Regional & Language Options in the Control Panel, and, in the Advanced Tab, select Hebrew as the non_Unicode language.

    That causes its own problems, as now all dates are in Israeli format, namely day/month/year instead of the US format of month/day/year. To fix that, in the Regional Options tab, select the Hebrew language and click on the Customize box.

    In the now-open Customize Regional Options form, select the Date tab. In the Short Date Format combo box, there is no US format; all formats are day-first instead of month-first. However, if you type in manually "MM/dd/yy" (without the quotes) and click Apply, it will save correctly, surprisingly enough. 'X' out of the form, and click OK in Regional & Language Options. You should be good to go!

    Thanks for listening, guys.

    Sam

Posting Permissions

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