Option Compare Binary
Private Sub Command1_Click()
Const tbl As String = "CentenialProteinImport"
'Add new fields 'supplier' and 'category', both text, max 30 chars
CurrentDb.Execute "alter table " & tbl & " add [supplier] text (30), [category] text (30)"
'split string up based on caps
Dim i As Integer
Dim s As String
Dim v As Variant
Dim d As String
For i = 1 To Len(tbl)
Select Case Mid(tbl, i, 1)
Case "A" To "Z": d = ";"
Case Else: d = ""
End Select
s = s & d & Mid(tbl, i, 1)
Next
If Left(s, 1) = ";" Then s = Mid(s, 2)
'assume first array element is supplier and second is category
Dim supplier As String
Dim category As String
supplier = Split(s, ";")(0)
category = Split(s, ";")(1)
'update table
CurrentDb.Execute "update [" & tbl & "] set [supplier]='" & supplier & "', [category]='" & category & "'"
End Sub