Solved Skip one field by name

Puff

New member
Local time
Today, 19:46
Joined
May 27, 2020
Messages
13
Hi everyone,

Is it possible within a function to ignore one field by it's name? i.e not return any value.

The code I have already ignores the ID number by use of If, Else, Then

Code:
With rst
        For Each f In .Fields
            If (f.Attributes And dbAutoIncrField) Then ' always skip the AutoNumber Primary Key
            Else
                clone.Fields(f.Name) = f
            End If
        Next f
    End With

I was wondering if I could also exclude another field just by it's name?

Puffs
 
How about?

If (f.Attributes...) AND f.Name = "NameToIgnore" Then
 
Wouldn't that be:

If (f.Attributes...) OR f.Name = "NameToIgnore" Then
 
Hi Chaps, thank you for this as soon as I get back home, I will test
 

Users who are viewing this thread

Back
Top Bottom