Form Design lost focus.

C

Curt Hand

I am using Acess 2003 and I am having a problem with the folowing code;

Dim rs As Object


Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblLFTests " & "WHERE
LFLabIDNo = '" & [LotLabIDNo] & "' OR LFLabIDNo = '" & [BulbLabIDNo] & "' OR
LFLabIDNo = '" & [MiscLabIDNo] & "' OR LFLabIDNo = '" & [StoreLabIDNo] & "'")

If Not rs.BOF And Not rs.EOF Then
LFTestNo = rs![LFTestNo]
LFTestType = rs![LFTestType]
GCMethod = rs![GCMethod]
LFGCRunDate = rs![LFGCRunDate]
LFExperimentInfo = rs![LFExperimentInfo]
LFExperimentSampNo = rs![LFExperimentSampNo]
LFLabIDNo = rs![LFLabIDNo]
LFCount = rs![LFCount]
LFResearchCount = rs![LFResearchCount]
TSCount = rs![TSCount]
LFArea = rs![LFArea]
IntStdArea = rs![IntStdArea]
LFComment = rs![LFComment]

End If
rs.Close
Set rs = Nothing

The code works very well except that I have different LFTestNo for different
TestNo.

When I come to a new TestNo that has a different LFTestNo but has an
identical LabIDNo in the 4 different OR's the form pulls the earliest
LFTestNo and not the correct LFTestNo information. What could I add to this
code to make the TestNo in the tblLFTests = the forms TestNo first and insert
the correct information is entered into the form.

Your help in this matter will be greatly appreciated.
Curt
 
Top