Fordraiders
asked on
I need to make a check in a field to see if more than One number exists in the field
Access 2010 VBA
I need to make a check in a field to see if more than One number exists in the field.
Field1
' Currently i check for blank values in that field.
after that check is completed, I need to see if any number variations exists.
Field1 should contain the same number
Example:
Field1
2321
2321
2321
etc...
If this exists:
2321
2322
2321
2324
Then I need to stop the routine with a message nox !
Thanks
fordraiders
I need to make a check in a field to see if more than One number exists in the field.
Field1
' Currently i check for blank values in that field.
after that check is completed, I need to see if any number variations exists.
Field1 should contain the same number
Example:
Field1
2321
2321
2321
etc...
If this exists:
2321
2322
2321
2324
Then I need to stop the routine with a message nox !
Dim R As DAO.Recordset
' NOW LOOK TO SEE FOR NULL RECORDS?
Set R = CurrentDb.OpenRecordset("SELECT * FROM [escalation_detail] ", dbOpenDynaset, dbSeeChanges)
' any ID nulls ?
R.MoveLast
R.MoveFirst
While Not R.EOF
If IsNull(R.Fields(1).Value) Then
MsgBox "You Have Blank Record IDS. Double Check Your Import!", vbCritical
R.Close
Set R = Nothing
Exit Sub
End If
R.MoveNext
Wend
Thanks
fordraiders
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Folks !
Sounds like a design problem. If all child records are supposed to contain the same value, then the field does NOT belong in that table. It belongs in the parent table.
ASKER
Should have thought of that.
fordraiders