Solved Skip one field by name (1 Viewer)

Puff

New member
Local time
Today, 08:48
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:48
Joined
Oct 29, 2018
Messages
21,496
How about?

If (f.Attributes...) AND f.Name = "NameToIgnore" Then
 

cheekybuddha

AWF VIP
Local time
Today, 08:48
Joined
Jul 21, 2014
Messages
2,288
Wouldn't that be:

If (f.Attributes...) OR f.Name = "NameToIgnore" Then
 

Puff

New member
Local time
Today, 08:48
Joined
May 27, 2020
Messages
13
Hi Chaps, thank you for this as soon as I get back home, I will test
 

Puff

New member
Local time
Today, 08:48
Joined
May 27, 2020
Messages
13
Thanks Guys, works like a charm!
 

Users who are viewing this thread

Top Bottom