Greatings everyone,
I'm looking to build my String with all the values of the field "DmgTypeNCom" from my recordset but i'm having no luck. The String should look like this:
"Concealed" & ";" & "Dropping" & ";" & "Forklift" & ";" & "On Divert" & ";"
but instead it only gives me the last record of "On Divert" in the String. Any help is most appreciated.
I'm looking to build my String with all the values of the field "DmgTypeNCom" from my recordset but i'm having no luck. The String should look like this:
"Concealed" & ";" & "Dropping" & ";" & "Forklift" & ";" & "On Divert" & ";"
but instead it only gives me the last record of "On Divert" in the String. Any help is most appreciated.
Code:
Dim strSQL As String
Dim rs As DAO.Recordset
On Error Resume Next
strSQL = "SELECT tblAdjDmgCommDropDown.DmgTypeNCom FROM tblAdjDmgCommDropDown " & _
"WHERE (((tblAdjDmgCommDropDown.AdjCode)='" & Me.AdjCode.Value & "')) " & _
"ORDER BY tblAdjDmgCommDropDown.DmgTypeNCom;"
Set rs = sqlDB().OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
Dim GroupThis As String
With rs
.MoveFirst
Do Until .EOF
GroupThis = !DmgTypeNCom & ";"
.MoveNext
Loop
End With
Me.DmgType.RowSource = GroupThis ' set new RowSource for combobox
Me.DmgType.Requery ' referesh it
Me.DmgType.Enabled = True ' make sure it's enabled
Me.DmgType.SetFocus