Hi,
I would really appreciate if someone can help me here. I am working on setting up a Document Control System and have a table, called List_of_SOP where I have, amongst others, the following fields:
- Document Title
- Document Number (unique identifier)
- Responsible
- DL (where this is a multiline lookup column where one ticks the names of the people to whom this document needs to be distributed)
I want to be able to fill an array with the checked values of the DL field, given a particular Document Number. Can someone help me please on how to go around this? So far, the code is somewhat on these lines:
__________________________________________________________________
Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset
Dim rs3 As DAO.Recordset
Dim db As DAO.Database
Dim strSQL1 As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim docTitleItems(50) As String
Dim respPerson(50) As String
Dim distList(50) As String
Dim dlitems(50) As String
Set db = CurrentDb
For intI = LBound(strSOPArr) To UBound(strSOPArr)
strSQL1 = "SELECT [Document Title] FROM
[List_of_SOP] WHERE [Document Number] = " & intSOPArr(intI)
strSQL2 = "SELECT [Responsible] FROM
[List_of_SOP] WHERE [Document Number] = " & intSOPArr(intI)
strSQL3 = "SELECT [DL] FROM
[List_of_SOP] WHERE [Document Number] = " & intSOPArr(intI)
Set rs1 = db.OpenRecordset(strSQL1)
Set rs2 = db.OpenRecordset(strSQL2)
Set rs3 = db.OpenRecordset(strSQL3)
docTitleItems(intI) = rs1.Fields("Document Title")
respPerson(intI) = rs2.Fields("Responsible")
'distList(intI) = rs3.Fields("DL")
rs1.MoveNext
rs2.MoveNext
rs3.MoveNext
Next
__________________________________________________________________
Thanks a lot
I would really appreciate if someone can help me here. I am working on setting up a Document Control System and have a table, called List_of_SOP where I have, amongst others, the following fields:
- Document Title
- Document Number (unique identifier)
- Responsible
- DL (where this is a multiline lookup column where one ticks the names of the people to whom this document needs to be distributed)
I want to be able to fill an array with the checked values of the DL field, given a particular Document Number. Can someone help me please on how to go around this? So far, the code is somewhat on these lines:
__________________________________________________________________
Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset
Dim rs3 As DAO.Recordset
Dim db As DAO.Database
Dim strSQL1 As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim docTitleItems(50) As String
Dim respPerson(50) As String
Dim distList(50) As String
Dim dlitems(50) As String
Set db = CurrentDb
For intI = LBound(strSOPArr) To UBound(strSOPArr)
strSQL1 = "SELECT [Document Title] FROM
[List_of_SOP] WHERE [Document Number] = " & intSOPArr(intI)
strSQL2 = "SELECT [Responsible] FROM
[List_of_SOP] WHERE [Document Number] = " & intSOPArr(intI)
strSQL3 = "SELECT [DL] FROM
[List_of_SOP] WHERE [Document Number] = " & intSOPArr(intI)
Set rs1 = db.OpenRecordset(strSQL1)
Set rs2 = db.OpenRecordset(strSQL2)
Set rs3 = db.OpenRecordset(strSQL3)
docTitleItems(intI) = rs1.Fields("Document Title")
respPerson(intI) = rs2.Fields("Responsible")
'distList(intI) = rs3.Fields("DL")
rs1.MoveNext
rs2.MoveNext
rs3.MoveNext
Next
__________________________________________________________________
Thanks a lot