Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating a field based on other field

Status
Not open for further replies.

wshs1

Technical User
Jun 22, 2006
23
US
so im using the dlookup function.

i have a form, and i would like to update the field "paID" when user fills out the "PrNum" field.
this is what i have.. im getting a mistype match.
so user types in the prnum, i want access to look up the tbl1_PurchaseRequisition and find the "PaID" which has the same prNum.

Private Sub Prnum_AfterUpdate()

Dim varpaID As Variant

Me.paID = DLookup("paid", "tbl1_PurchaseRequisition", "Prnum = '" & Me![Prnum] & "'")

Me.paID.Requery

End Sub
 
Hi!

Maybe you need to take the single quotes out of the DLookUp function assuming Prnum means that it is a number.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
just saw that.. but thank you~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top