S
SEAN DI''''ANNO
Hello all,
I really hope some one can help me. I have been gaing fast over the last
couple of days trying to get the code list at the bottom to work properly.
I am writing a data scoring database and I am struggling on a certain rule.
The database loops through a list of new contacts and for each one then
loops through each field and again through any rule set up against the field.
I am trying to check whether the new contacts email address (fldfield.value)
ends with a suitable email ending. I have done this by having a list of
rules with a unique rule identifier which then links to another table (by
rule identifier) with items to look for;
So...rstfieldrules RuleIdentifier 12
rstListItems....
RuleLink RuleValue
12 .com
12 .co.uk
This is my code...note this is my first ever datasbase so it probably not
very effient.
Set db = CurrentDb()
Set RS4 = db.OpenRecordset("tblListItems", dbOpenDynaset)
ListCriteria = "RuleLink like " & rstFieldRules!RuleIdentifier
RS4.MoveFirst
RS4.FindFirst ListCriteria
If InStr(1, RS4!RuleValue, fldfield.Value) > 0 Then GoTo
CloseCase11
'fldfield.value is the email address in this case picked up
from the new contact
Do Until RS4.NoMatch
RS4.MoveNext
RS4.FindNext Criteria
If InStr(1, RS4!RuleValue, fldfield.Value) > 0 Then GoTo
CloseCase11
Loop
'******************
'Item was not found
'******************
DataScore = DataScore - ScoreDeduction
blnFieldHasError = True
DoesNotApply = False
'***********
CloseCase11:
'***********
RS4.Close
Set RS4 = Nothing
Not only is the routine considerably slowing down the whole process but...it
is not identifying any correct email addresses. Please, please tell me where
I am going wrong
I really hope some one can help me. I have been gaing fast over the last
couple of days trying to get the code list at the bottom to work properly.
I am writing a data scoring database and I am struggling on a certain rule.
The database loops through a list of new contacts and for each one then
loops through each field and again through any rule set up against the field.
I am trying to check whether the new contacts email address (fldfield.value)
ends with a suitable email ending. I have done this by having a list of
rules with a unique rule identifier which then links to another table (by
rule identifier) with items to look for;
So...rstfieldrules RuleIdentifier 12
rstListItems....
RuleLink RuleValue
12 .com
12 .co.uk
This is my code...note this is my first ever datasbase so it probably not
very effient.
Set db = CurrentDb()
Set RS4 = db.OpenRecordset("tblListItems", dbOpenDynaset)
ListCriteria = "RuleLink like " & rstFieldRules!RuleIdentifier
RS4.MoveFirst
RS4.FindFirst ListCriteria
If InStr(1, RS4!RuleValue, fldfield.Value) > 0 Then GoTo
CloseCase11
'fldfield.value is the email address in this case picked up
from the new contact
Do Until RS4.NoMatch
RS4.MoveNext
RS4.FindNext Criteria
If InStr(1, RS4!RuleValue, fldfield.Value) > 0 Then GoTo
CloseCase11
Loop
'******************
'Item was not found
'******************
DataScore = DataScore - ScoreDeduction
blnFieldHasError = True
DoesNotApply = False
'***********
CloseCase11:
'***********
RS4.Close
Set RS4 = Nothing
Not only is the routine considerably slowing down the whole process but...it
is not identifying any correct email addresses. Please, please tell me where
I am going wrong