Hi, I have the following code below bet it comes up with a '424' error object required. I cant see what is wrong with the code. I have declared and set the recordset aswel. Any Ideas?
Code:
If rstP("V") Is Not Null Then
txtV.Value = DLookup("V", "tblP", "ID =""" & Forms![frmP]!cboP & """")
ElseIf rstP("W") Is Not Null Then
txtV.Value = DLookup("W", "tblP", "ID =""" & Forms![frmP]!cboP & """")
End If
Code:
If rstP("V") Is Not Null Then
txtV.Value = DLookup("V", "tblP", "ID =""" & Forms![frmP]!cboP & """")
ElseIf rstP("W") Is Not Null Then
txtV.Value = DLookup("W", "tblP", "ID =""" & Forms![frmP]!cboP & """")
End If