I have three strings defined in code that i need to initialize. in these three strings i am building a record key from data in an access table that will be used in another system (MAS90 accounting system). My trouble is that after processing the first record in the table, when processing the next record, the "strings" still contain data from the first record key that was constructed. i think i need to clear these strings out before starting on the next record but i am not a coder and don't know how to do this (can't find the instruction that does this). can someone help ? code i am using is below, <br>Thankyou so mucn ! <br>Paul<br> <br>Public Sub UpdateKey()<br><br>Dim db As DAO.Database<br>Dim rst As DAO.Recordset<br>Dim strSize As String<br>Dim strBoName1 As String<br>Dim strBoName2 As String<br>Dim bytCount As Byte<br>Dim bytPos As Byte<br>Dim strKey As String<br><br>Set db = CurrentDb<br>Set rst = db.OpenRecordset("SELECT * FROM AllItemsConsolidatedTable"<br><br>Do While Not rst.EOF<br><br>'Create Size string from field, eliminating spaces <br><br> For bytCount = 1 To Len(rst!BriefDescription)<br> If Mid(rst!BriefDescription, bytCount, 1) > " " Then<br> strSize = strSize & Mid(rst!BriefDescription, bytCount, 1)<br> End If<br> Next bytCount<br><br>'Find where a "'" is and grab the first 8 characters of that<br> <br> bytPos = InStr(rst![ItemName], "'"<br> If bytPos <> 0 Then<br> strBoName2 = Mid(rst![ItemName], bytPos, 8)<br> Else<br> strBoName2 = ""<br> End If<br><br>'Create Botanical Name string without spaces (not working)<br><br> For bytCount = 1 To Len(rst![ItemName])<br> If Mid(rst![ItemName], bytCount) <> " " Then<br> strBoName1 = strBoName1 & Mid(rst![ItemName], bytCount)<br> End If<br> Next bytCount<br><br>'Grab what is left over of the botanical name (works)<br><br> strBoName1 = Left(strBoName1, (30 - Len(strSize) - Len(strBoName2)))<br><br>'Assign the key string<br><br> strKey = strBoName1 & strBoName2 & strSize<br><br>'Edit the record<br><br> rst.Edit<br> rst!MAS90ITEMKEY = strKey<br> rst.Update<br><br>'move to the next record if there is one<br><br> If Not rst.EOF Then<br> rst.MoveNext<br> End If<br>Loop<br><br>rst.Close<br>Set rst = Nothing<br>Set db = Nothing<br><br>End Sub<br><br>