Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Morecambe England, Lancashire, England
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error Messages (Windows 98/Office 2000)

    When ever I design a label report I usually get the error message:-

    "Some data may not be displayed
    There is not enough horizontal space on the page for the number and column spacing you specified."

    I simply click OK and it always prints perfectly satisfactorily. However I am now having a purge on any error message that appears and I am sure that there is a way to trap this one.

    Does anyone know what it is? Thanks in anticipation

    Michael Peak
    Morecambe, England

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error Messages (Windows 98/Office 2000)

    Open the report in design view.
    Try to drag the right edge of the report to the left as far as possible.
    Close and save the report, and see if the error message has gone.
    If not, decrease the right margin a bit in File | Page Setup.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Morecambe England, Lancashire, England
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Messages (Windows 98/Office 2000)

    Hi Hans,

    Thanks for the reply. I've done what you suggest many times in the past and it works with all my reports except labels, which give this message every time. I think its to do with the size of label I use.

    I can live with it, but I was wondering if there was a way of simply trapping that error message, rather like the way you can trap it if there is no data with :-

    Private Sub Report_NoData(Cancel As Integer)
    MsgBox "There are no comments that match. Canceling report..."
    Cancel = -1
    End Sub

    Thanks for all your help

    Michael

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error Messages (Windows 98/Office 2000)

    to get rid of the error message entirely would involve a lot of fiddling with the column settings of the label report, it may not be worth while to spend a lot of time on it.

    If you open the report in code, you can suppress the error message like this:

    DoCmd.SetWarnings False
    DoCmd.OpenReport "rptLabels", acViewPreview
    DoCmd.SetWarnings True

  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Morecambe England, Lancashire, England
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Messages (Windows 98/Office 2000)

    Thanks Hans,

    Er just one tiny point I know how to do a report in code from a button on a form - this one for example is the code for a button on a form that prints an envelope for just that record. So I can see exactly what I would have to do if I wanted the button to print labels

    Private Sub Print_Env_Click()
    On Error GoTo Exit_Print_Env_Click

    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.OpenReport "DL Envelopes", acPreview, , "[Refno] = " & [RefNo]


    Exit_Print_Env_Click:
    Exit Sub

    End Sub


    In this case I want it to print from the switchboard, so I realise that I would tell the switchboard manager that I want to run code rather than a report. I can do that OK, but my problem is I'm not sure where to put the code. Do I have to start a new module? If I do could you just start me off in the right direction of how to do that or at least point me to a post that might help.

    This is the point were I realise my limitations I cam modify existing code, but starting from scratch on a completely new bit of code is a different matter.

    Thanks again

    Michael

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error Messages (Windows 98/Office 2000)

    To run code from the switchboard, you must create a standard module (i.e. click New in the Modules section of the database window, or select Insert | Module in the Visual Basic Editor), and create a function or procedure without arguments, i.e.

    Public Function Test()
    ...
    End Function

    or

    Public Sub Test()
    ...
    End Sub

    You can then specify the name of the function/procedure in the Switchboard Manager as argument for the Run Code command.

  7. #7
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Morecambe England, Lancashire, England
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Messages (Windows 98/Office 2000)

    Thanks Hans

    I understand what you mean - sorry if it sounds so basic

    Michael

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error Messages (Windows 98/Office 2000)

    No problem - we've all had to learn how to create code.

Posting Permissions

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