G
Guest
I am using the FIND code below and it works well on all but the "requestedby"
(which is a combo box which is viewed as a name but stored as a number.)
SELECT DISTINCT Overseer.OverseerID, Overseer.LastName, Overseer.FirstName,
Overseer.Department FROM Overseer WHERE (((Overseer.LastName) Is Not Null))
ORDER BY Overseer.LastName, Overseer.Department;
I want to be able to search in this code by the name. I tried the following
after the first error handler. I don't know where it should go (I get error
2001, previous ... xceled)
'lookup value for "requestedby"
RequestedBy = DLookup("[LastName]", "Overseer", "[OverseerID]='" &
Forms!OrdersWDetails!RequestedBy & "'")
Thanks in advance!
lmv
'--------FIND CODE---------
Private Sub FindRecordLike(strFindMode As String)
'Copyright 2003 J Street Technology, Inc.
'www.JStreetTech.com
'May be used and distributed without permission if these 3 lines are included.
On Error GoTo Error_Handler
'PO number shows up in search additional fields show up as ID numbers
Call jst_FindRecord(frmCallingForm:=Me, _
ctlFindFirst:=Me!cmdFirst, _
ctlFindNext:=Me!cmdNext, _
ctlSearchText:=Me!txtFind, _
ctlSearchOption:=Me!optFind, _
strFindMode:=strFindMode, _
strField1:="ProjectID", _
strField2:="PurchaseOrderNumber", _
strField3:="RequestedBy")
Exit_Procedure:
Exit Sub
Error_Handler:
MsgBox Err.Number & ", " & Err.Description
Resume Exit_Procedure
Resume
End Sub
(which is a combo box which is viewed as a name but stored as a number.)
SELECT DISTINCT Overseer.OverseerID, Overseer.LastName, Overseer.FirstName,
Overseer.Department FROM Overseer WHERE (((Overseer.LastName) Is Not Null))
ORDER BY Overseer.LastName, Overseer.Department;
I want to be able to search in this code by the name. I tried the following
after the first error handler. I don't know where it should go (I get error
2001, previous ... xceled)
'lookup value for "requestedby"
RequestedBy = DLookup("[LastName]", "Overseer", "[OverseerID]='" &
Forms!OrdersWDetails!RequestedBy & "'")
Thanks in advance!
lmv
'--------FIND CODE---------
Private Sub FindRecordLike(strFindMode As String)
'Copyright 2003 J Street Technology, Inc.
'www.JStreetTech.com
'May be used and distributed without permission if these 3 lines are included.
On Error GoTo Error_Handler
'PO number shows up in search additional fields show up as ID numbers
Call jst_FindRecord(frmCallingForm:=Me, _
ctlFindFirst:=Me!cmdFirst, _
ctlFindNext:=Me!cmdNext, _
ctlSearchText:=Me!txtFind, _
ctlSearchOption:=Me!optFind, _
strFindMode:=strFindMode, _
strField1:="ProjectID", _
strField2:="PurchaseOrderNumber", _
strField3:="RequestedBy")
Exit_Procedure:
Exit Sub
Error_Handler:
MsgBox Err.Number & ", " & Err.Description
Resume Exit_Procedure
Resume
End Sub