HI,
Wondering if someone could give me a helping hand here...
I have a form which holds 2x listboxes. I want to be able to select a value from each column that is selected in the left hand list (lstIColSW) and a value from a specific column name in the the right hand list (lstMLSWList).
lstIColSW is being displayed with the following query:
---------------------------------------------------------
SELECT tblSWInstallBase.Manufacturer, tblSWInstallBase.Product, tblSWInstallBase.Version AS Ver, tblSWInstallBase.Release AS Rls FROM tblSWInstallBase GROUP BY tblSWInstallBase.Manufacturer, tblSWInstallBase.Product, tblSWInstallBase.Version, tblSWInstallBase.Release ORDER BY tblSWInstallBase.Manufacturer, tblSWInstallBase.Product, tblSWInstallBase.Version, tblSWInstallBase.Release;
---------------------E O F-------------------------------
lstMLSWList is being displayed with the following query:
---------------------------------------------------------
SELECT DISTINCT tblMLSoftwareList.Software_ID AS [ML ID], tblMLSoftwareList.Manufacturer, tblMLSoftwareList.Product, tblMLSoftwareList.Version
FROM tblMLSoftwareList
ORDER BY tblMLSoftwareList.Manufacturer, tblMLSoftwareList.Product, tblMLSoftwareList.Version;
---------------------E O F-------------------------------
I want each of the selected values to write data into a new table. I have created a button on the form for this, and have the following VBA code, which has been compiled from a similar question in this forum....
---------------------------------------------------------
---------------------E O F-------------------------------
There are currently 2 issues with this code...
1: I want each of the seperate reported values, to be entered into unique fields in a new table, which will be used as a reference for SWInstallations. At the moment I cannot figure out how to put Value 2 into a seperate field (It currently goes into "Manufacturer" as I have coded)
2: I also get the following error:
"error 3393
Cannot perform join, group, sort, or indexed restriction. A value being searched or sorted on is too long."
Again can anyone explain this?? I have used a similar code (without differing values being written into a table, i.e. the same value being entered into each field works) and do not get any errors at all...
/ Searchin the web doesn't really help out either...
Thanks in Adv for any help/advise/resources that you can give...
Wondering if someone could give me a helping hand here...
I have a form which holds 2x listboxes. I want to be able to select a value from each column that is selected in the left hand list (lstIColSW) and a value from a specific column name in the the right hand list (lstMLSWList).
lstIColSW is being displayed with the following query:
---------------------------------------------------------
SELECT tblSWInstallBase.Manufacturer, tblSWInstallBase.Product, tblSWInstallBase.Version AS Ver, tblSWInstallBase.Release AS Rls FROM tblSWInstallBase GROUP BY tblSWInstallBase.Manufacturer, tblSWInstallBase.Product, tblSWInstallBase.Version, tblSWInstallBase.Release ORDER BY tblSWInstallBase.Manufacturer, tblSWInstallBase.Product, tblSWInstallBase.Version, tblSWInstallBase.Release;
---------------------E O F-------------------------------
lstMLSWList is being displayed with the following query:
---------------------------------------------------------
SELECT DISTINCT tblMLSoftwareList.Software_ID AS [ML ID], tblMLSoftwareList.Manufacturer, tblMLSoftwareList.Product, tblMLSoftwareList.Version
FROM tblMLSoftwareList
ORDER BY tblMLSoftwareList.Manufacturer, tblMLSoftwareList.Product, tblMLSoftwareList.Version;
---------------------E O F-------------------------------
I want each of the selected values to write data into a new table. I have created a button on the form for this, and have the following VBA code, which has been compiled from a similar question in this forum....
---------------------------------------------------------
Code:
Dim dbs As Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblSWLink_test") ' - [b]Debugger errors here[/b]
Dim frm As Form, ctl As Control
Dim varItm As Variant, intI As Integer
Set frm = Forms!frmSWLink
Set ctl = frm!lstIColSW
For Each varItm In ctl.ItemsSelected
For intI = 0 To ctl.ColumnCount - 1
MsgBox ctl.Column(intI, varItm)
rst.AddNew
rst!Manufacturer = Me.lstIColSW.Value '- [b]The next value needs to go to a [u]different field[/u] in the destination table[/b]
Next intI
Next varItm
rst!AppID = Me.lstMLSWList.Value
rst.Update
rst.Close
End Sub
There are currently 2 issues with this code...
1: I want each of the seperate reported values, to be entered into unique fields in a new table, which will be used as a reference for SWInstallations. At the moment I cannot figure out how to put Value 2 into a seperate field (It currently goes into "Manufacturer" as I have coded)
2: I also get the following error:
"error 3393
Cannot perform join, group, sort, or indexed restriction. A value being searched or sorted on is too long."
Again can anyone explain this?? I have used a similar code (without differing values being written into a table, i.e. the same value being entered into each field works) and do not get any errors at all...
Thanks in Adv for any help/advise/resources that you can give...