P
perryclisbee via AccessMonster.com
(see code below as a reference)
I have a list of facilities in a listbox [lstFacAdd] on a form
[frm_credreqdetails], pulling from a source table [tbl_cr_facilities]. I
currently have it set up so that when I double click on one of those
facilities, it adds that facility to another listbox on another form [Forms!
frm_CR_ViewFacilities!lstFacilities].
What I want to do is allow multiple selections to be hightlighted from the
[lstFacAdd] listbox, and then be simultaneously copied over to the other
listbox. maybe a coded button that will take the hightlighted selections and
copy them all over at the same time.
Is there any way to do these two things?
thanks,
Perry
CODE:
Dim db As Database
Dim rs As Recordset
Private Sub lstFacAdd_DblClick(Cancel As Integer)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Set db = CurrentDb
Set rs = db.OpenRecordset("TBL_CR_FACILITIES")
rs.AddNew
rs("FK_CR_ID") = Forms!frm_Credreqdetails!ID.Value
rs("FAC_NO") = lstFacAdd
rs.Update
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Forms!frm_CR_ViewFacilities!lstFacilities.Requery
End Sub
I have a list of facilities in a listbox [lstFacAdd] on a form
[frm_credreqdetails], pulling from a source table [tbl_cr_facilities]. I
currently have it set up so that when I double click on one of those
facilities, it adds that facility to another listbox on another form [Forms!
frm_CR_ViewFacilities!lstFacilities].
What I want to do is allow multiple selections to be hightlighted from the
[lstFacAdd] listbox, and then be simultaneously copied over to the other
listbox. maybe a coded button that will take the hightlighted selections and
copy them all over at the same time.
Is there any way to do these two things?
thanks,
Perry
CODE:
Dim db As Database
Dim rs As Recordset
Private Sub lstFacAdd_DblClick(Cancel As Integer)
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Set db = CurrentDb
Set rs = db.OpenRecordset("TBL_CR_FACILITIES")
rs.AddNew
rs("FK_CR_ID") = Forms!frm_Credreqdetails!ID.Value
rs("FAC_NO") = lstFacAdd
rs.Update
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Forms!frm_CR_ViewFacilities!lstFacilities.Requery
End Sub