473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hard return in unbound textbox printing in report

Hi

I have a form that contains a multiselect listbox (simple multiselect)
and a command button. The listbox shows a list of all reports (about
20) available for users to print and the command button has an
onclick() event for printing these reports.

I also have a textbox in the form that shows which reports have been
selected.

I have these lines of code attached to the OnClick() event on the
listbox (initially graciously provided by Arvin Meyer MVP but with
slight modifications)

Private Sub ReportList_Click()

Dim varItem As Variant
Dim strList As String

With Me!ReportList
If .MultiSelect = 0 Then
Me!txtSelected = .Value

Else
For Each varItem In .ItemsSelected
strList = strList & .Column(0, varItem) & vbNewLine
Next varItem

If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)

End If
Me.Text3 = strList

End If
End With
End Sub

Code works fine but when i go to print a report with the results of the
textbox, i get a small box - unprintable character (hard return??)at
the end of the last selection. I found how to get rid of it with an
update query in a table in other postings but since my textbox is
unbound, i can't seem to find a way to get rid of this character.

Thanks for your help

Nov 13 '05 #1
1 2992
You might try

Private Sub ReportList_Click()

Dim varItem As Integer
Dim strList As String

With Me!ReportList
If .MultiSelect = 0 Then
Me!txtSelected = .Value

Else
For Each varItem In .ItemsSelected -1
strList = strList & .Column(0, varItem) & vbCRLF
Next varItem
strList = strList & .Column(0, varItem) ' I think this should pick up
the last row without the additional New Line
> Me.Text3 = strList
End If
End With
End Sub


Phil

"ManuelC" <bo****@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... Hi

I have a form that contains a multiselect listbox (simple multiselect)
and a command button. The listbox shows a list of all reports (about
20) available for users to print and the command button has an
onclick() event for printing these reports.

I also have a textbox in the form that shows which reports have been
selected.

I have these lines of code attached to the OnClick() event on the
listbox (initially graciously provided by Arvin Meyer MVP but with
slight modifications)

Private Sub ReportList_Click()

Dim varItem As Variant
Dim strList As String

With Me!ReportList
If .MultiSelect = 0 Then
Me!txtSelected = .Value

Else
For Each varItem In .ItemsSelected
strList = strList & .Column(0, varItem) & vbNewLine
Next varItem

If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)

End If
Me.Text3 = strList

End If
End With
End Sub

Code works fine but when i go to print a report with the results of the
textbox, i get a small box - unprintable character (hard return??)at
the end of the last selection. I found how to get rid of it with an
update query in a table in other postings but since my textbox is
unbound, i can't seem to find a way to get rid of this character.

Thanks for your help

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
4
by: Rick Thiel | last post by:
Hello, I am trying to build a Crystal report VisualStudio.NET for an ASP.NET application. I would like to build a report that doesn't connect to any particular database at design time because I...
2
by: Jayjay | last post by:
I've got a report that has a series of unbound text boxes that are being populated by some variables in code. The format is supposed to be a currancy format, but on a certain series of boxes, I...
0
by: d3b_k | last post by:
Using Access2k with SQL2k. Form is unbound. TextBox is from an stored proc that should display a varchar field on the SQL server that can hold up to 1200. The 1200 was recently changed from 300...
2
by: Paul .V. | last post by:
I have a report which I call to print from a form. For security reasons I have created a global variable: Const Company = "This Test Company" I call that constant whereever I want the company...
0
by: jaYPee | last post by:
I have an unbound textbox in my report that is bound from the textbox in my Dialog Form using a controlsource using Access 97. However after I ported my database to SQL Server 2000 and use Access...
2
by: EManning | last post by:
Using A2K. I have a series of unbound textboxes on a report. I made a duplicate of these textboxes (Edit...Duplicate) to make a new series, then put this new series on another report. But I...
0
by: colleen1980 | last post by:
Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the...
1
by: Donna Richelle | last post by:
I am using Access 2003 and am having some trouble printing unbound fields on a report. When I do a Preview of the report, the data in the unbound field shows perfectly, but when I print a hardcopy,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.