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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup woes-not updating

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
Below is the code I have on a subform (MainEntryQrySelectSubFRM1).
Can someone tell me what is wrong with this code? When I
click the next button I want the Value in the Method10
field to change according to what the Pull Code Value is
in the query for that record. I am not sure if I explained
this very well.

Code:
Private Sub Next10_Click()
On Error GoTo Err_Next10_Click

    DoCmd.GoToRecord , , acNext
        Me.Method10.Value = _
        DLookup("[Method]", "ReplenishMethodTbl", "[PullSeqCode] = '" & _
        DLookup("[Pull Code]", "MainEntryQrySelectSub1") & "'")

    Me.Signal10 = Blank

Exit_Next10_Click:
    Exit Sub

Err_Next10_Click:
    MsgBox Err.Description
    Resume Exit_Next10_Click
    
End Sub
 
I would guess that DlookUp is returning null. Have you tried stepping through the code?

It may be worth checking the value of
DLookup("[Pull Code]", "MainEntryQrySelectSub1")
separately.
 
How are ya netrusher . . .

My 1st observation is that the [blue]2nd DLoopUp has no criteria![/blue] Which means it returns the first [blue][Pull Code][/blue] found!

Logically it doesn't appear this is what you want! . . .

[blue]Your Thoughts! . . .[/blue]


Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top