Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation rule on import

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
0
0
GB
Is it possible to have a validation rule work on two fields while importing a file. I import a number of files which are a fair size, but i only need some of the records. Those that contain a true value in either field1 or field2, the rest are not required.
So if field1 is true but field2 is false, OK import the record
If field1 is false but field2 is true, OK import he record
If field1 is false and field2 is false, skip the record.

Can anyone help.?

"Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children."...Bill Hicks
 
Sorry,

I forgot to add that i had tried this in the validation rule field :-

=True Or ([Loss_Flag])=True

but got an error

"Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children."...Bill Hicks
 
Scottian

You either import all and then delete those not required with a DELETE query, or link the txt file and run an append query filtering records you need.
 
Can't you use a Table level validation rule ?
field1=True OR Field2=True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

If youre talking about validation rule in the table design, ive tried this...

([GAIN_Flag])="Yes" Or ([Loss_Flag])="Yes"

but i get an error telling me the database engine doesnt recognise either field. and properties werent changed.

the reason im trying to do this is because the files i import consist of about 100,000 records approx 10% of which are all i need.

Something i allways forget to mention is that im using Access '97

"Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children."...Bill Hicks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top