H
Hanif Merali
Hello, I'm having some trouble with some syntax, and was wondering if
someone could help me out, or perhaps even offer me some advice as how to
write a query to do this. I have two tables, one is just one column filled
with text fields. I need to check every row of a particular column in
another table to see if that entire field contains the string from the other
table if it does I want to update another column of the same table to a
certain value. This is what I tried to write, I've never used VBA before
and am trying to learn syntax, any help would be greatly appreciated.
Public Function UpdateComRecords()
Dim keywordList(1 To 1376) As String
Dim tempInt(1 To 1376) As Integer
For i% = 1 To 1376
keywordList(i%) = [Commercial Key Words].[Company Keywords]
Next i%
End Sub
For i% = 1 To 1376
tempInt(i%) = InStr([Customers].[LNAME], keywordList(i%))
If tempInt(i%) <> 0 Then
'UPDATE Customers SET Customers.DNP = "1"
End If
Next i%
End Sub
End Function
Perhaps there is a better way to go about this? Thanks in advance.
Regards,
H.M.
someone could help me out, or perhaps even offer me some advice as how to
write a query to do this. I have two tables, one is just one column filled
with text fields. I need to check every row of a particular column in
another table to see if that entire field contains the string from the other
table if it does I want to update another column of the same table to a
certain value. This is what I tried to write, I've never used VBA before
and am trying to learn syntax, any help would be greatly appreciated.
Public Function UpdateComRecords()
Dim keywordList(1 To 1376) As String
Dim tempInt(1 To 1376) As Integer
For i% = 1 To 1376
keywordList(i%) = [Commercial Key Words].[Company Keywords]
Next i%
End Sub
For i% = 1 To 1376
tempInt(i%) = InStr([Customers].[LNAME], keywordList(i%))
If tempInt(i%) <> 0 Then
'UPDATE Customers SET Customers.DNP = "1"
End If
Next i%
End Sub
End Function
Perhaps there is a better way to go about this? Thanks in advance.
Regards,
H.M.