Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    1

    Unhappy Unanswered: ColumnWidths makes my Report crashed !

    Hi,

    I have a list box in my report and the following code in class module of the report (only a portion is shown):

    --------------------------------------------

    lstLDetail.RowSource = strsql
    lstLDetail.ColumnCount = 11
    lstLDetail.ColumnWidths = "0.5cm;0.5cm;0.5cm;0.5cm;0.5cm;0.5cm;0.5cm;0.5cm;0 .5cm;0.5cm;0.5cm;"

    --------------------------------------------

    where lstLDetail is the list box and strsql is a String variable containing a valid sql statement. The sql statements selects 11 fields.


    In another Form, these statements work fine. But in Report, the ColumnWidths method make my Access closed. The error message follows:

    --------------------------------------------

    MSACCESS.exe has generated errors and will be closed by Windows. You will need to restart the program.
    An error log is being created.

    --------------------------------------------

    If I remove the ColumnWidths method, no error appears but I cannot set the widths of the columns.

    Would you please tell me how to fix it?
    Thank you very much.

    Stephen

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    Lightbulb A Guess

    Maybe you can only make these changes in design view?

    Open the report in design view first (programatically), run the code then open in preview - give that a try.
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

Posting Permissions

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