Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    5

    Unanswered: Need some help with an expression

    I have a database where user can enter mulitple lines of comments for each record in a text box (Enter Key Behaviour is set at "New Line in Field"). There's also a Report that prints out a table of all the records and the related info, including comments. But due to papa size constraint, there is only room to display one line of comment for each record.

    Is it possible to write an expression so that when Access generates the Report, it'll recognize number of lines in the [Comment] field is >1, then replace with it with "See Database for the complete comment" on the report?

    For example: =IIf(????,"See Database for the complete comment",[Comment])

    The ???? is the part that I need help with. So will the IIF statment work? or I need to use something else? Thanks for any help.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    InStr([Comment],VbCrLf) > 0 ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jul 2004
    Posts
    5
    Quote Originally Posted by M Owen
    InStr([Comment],VbCrLf) > 0 ...
    Do I insert this to the ???? part? Like,

    =IIF(Instr([Comment],VbCrLf)>0,"See database for comelete comment",[Comment])

    and what is VbCrLf ??

    I just tried the code and it isn't working properly yet.

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Quote Originally Posted by Tommy Gunz
    Do I insert this to the ???? part? Like,

    =IIF(Instr([Comment],VbCrLf)>0,"See database for comelete comment",[Comment])

    and what is VbCrLf ??

    I just tried the code and it isn't working properly yet.
    You can put this code in the Report_Page() Event
    The VbCrLf= CarriaageReturn LineFeed

    Also why don't you use the property of the textBox in your Report (I think it is called extenden not sure, I use a german Acce$$) it is the 8th one from the beginning under the tab All in the property window, if you set it to True it will allow you to show the whole comment on many lines, irrespective of the room of the TextBox

Posting Permissions

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