I'm using DAO to create a database with an index for a given table with two
keys as the index field.
Here is a snippet of the code:
Dim sKey as String
sKey = "Customer_ID,Product_ID" ; two fields in the
customer pricing table
Set NewField = NewIndex.CreateField(sKey) <----- here is
where the error occurs
NewIndex.Primary = True
NewIndex.Unique = True
The problem is that it doesn't like the "sKey" to have a comma separating
the two fields I'm using for the key to the index. I tried a semi-colon, but
that doesn't work either; same problem.
I can say "sKey="Customer_ID" and that will work just fine.... albeit I
don't have the index properly defined as I want it utilizing both fields.
I can set up an index this way in Access, or even the utility that comes
with VB - just can't do it in code, yet I'm sure there is something I'm
If anyone can help, I'd sure appreciate it.
thanks in advance,