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))<>"~"
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.
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))<>"~"
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.