Set tres = CurrentDb().OpenRecordset("select * from depot where docnumber='" & Me!DOCNUMBER & "'", dbReadOnly)
Set rst = CurrentDb().OpenRecordset("select * from basectrl ", dbReadOnly)
If tres.EOF And tres.BOF Then
Exit Sub
End If
If rst.EOF And rst.BOF Then
Exit Sub
End If
Do While Not tres.EOF
typestr = tres!Type
typestr1 = rst!Type