N
Niklas Östergren
I have two form´s:
1.) <frmCreateEmailMsg>
2.) <frmAddAttachmentsToEmailMsg>
On form No1 (frmCreateEmailMsg) I have a unbound listbox (lstAttachedFiles)
which I want to fill with records selected from a bound listbox
(lstSelectFileName) on form No2 (frmAddAttachmentsToEmailMsg).
The bound control (lstSelectFileName) have following properies:
- RecordSourceType: Table/Query
- RecordSource: SELECT tblDocument ......
- Number of columns: 2
- Bound column: 1
After the user have selected one record from the bound listbox they add it
to the unbound listbox on form No1 with this code:
'============================
If IsLoaded("frmCreateEmailMsg") Then
strSelectedFiles = Me.lstSelectFileName & ";"
Forms!frmCreateEmailMsg.lstAttachedFiles.RowSourceType = "Value List"
Forms!frmCreateEmailMsg.lstAttachedFiles.RowSource =
Forms!frmCreateEmailMsg.lstAttachedFiles.RowSource & strSelectedFiles
End If
'============================
The problem I have is that what´s added to the unbound form is the first
column from the bound form. Which menas that the data added to the unbound
listbox is a primary key.
What I´d like to add is BOTH the primary key (column 1) AND Document path
which is shown in column 2 of the bound control.
I just don´t know how to do this!
TIA!
// Niklas
1.) <frmCreateEmailMsg>
2.) <frmAddAttachmentsToEmailMsg>
On form No1 (frmCreateEmailMsg) I have a unbound listbox (lstAttachedFiles)
which I want to fill with records selected from a bound listbox
(lstSelectFileName) on form No2 (frmAddAttachmentsToEmailMsg).
The bound control (lstSelectFileName) have following properies:
- RecordSourceType: Table/Query
- RecordSource: SELECT tblDocument ......
- Number of columns: 2
- Bound column: 1
After the user have selected one record from the bound listbox they add it
to the unbound listbox on form No1 with this code:
'============================
If IsLoaded("frmCreateEmailMsg") Then
strSelectedFiles = Me.lstSelectFileName & ";"
Forms!frmCreateEmailMsg.lstAttachedFiles.RowSourceType = "Value List"
Forms!frmCreateEmailMsg.lstAttachedFiles.RowSource =
Forms!frmCreateEmailMsg.lstAttachedFiles.RowSource & strSelectedFiles
End If
'============================
The problem I have is that what´s added to the unbound form is the first
column from the bound form. Which menas that the data added to the unbound
listbox is a primary key.
What I´d like to add is BOTH the primary key (column 1) AND Document path
which is shown in column 2 of the bound control.
I just don´t know how to do this!
TIA!
// Niklas