Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Box with Reports.

Status
Not open for further replies.

gtroiano

Technical User
Nov 7, 2001
99
US
i have an form to send email in access 2000. what i am trying to do is populate a list box on a pop up form with the names of the reports in my database; select a report from that list box and then move the report to a text box on the main form which is the control for sending attachements. as it is now, all of the above-mentioned works except when the name of the report is moved to the text box i believe it is just showing the name of the report and not actually referencing the report itself. if that makes sense? also, i can only select the first Report listed on the list box. this is what i've got so far:

lstReports - the list box.
txtAttachement - the text box.
CmdSelect - the command button.
frmSMTP - the main form.

this is the code in the rowsource of the list box -
SELECT MsysObjects.Name
FROM MsysObjects
WHERE (((Left$([Name],1))<>&quot;~&quot;) AND ((MsysObjects.Type)=-32764))
ORDER BY MsysObjects.Name;


this is the code behind the button that send the report from the list box to the text box -
Private Sub CmdSelect_Click()
Dim ctlList As Control, varItem As Variant

Set ctlList = lstReports

For Each varItem In ctlList.ItemsSelected

Forms!frmSMTP!txtAttachement = Forms!frmSMTP!txtAttachement & lstReports.column(varItem)
Next varItem
End Sub


i am at a complete loss. if someone could help me i would appreciate it.

jerry.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top