Update in Join Query

Drunkenneo

Registered User.
Local time
Today, 15:46
Joined
Jun 4, 2013
Messages
192
I am strucked to a simple join query please help

Iu41yRhLG9wAAAAASUVORK5CYII=


Here I want to update the Flag of tblDataentry if any one of the orig or dest is -1 else 0. Please Help
 

Attachments

  • update.jpg
    update.jpg
    31.4 KB · Views: 87
Last edited:
I am strucked to a simple join query please help

Iu41yRhLG9wAAAAASUVORK5CYII=


Here I want to update the Flag of tblDataentry if any one of the orig or dest is -1 else 0. Please Help
I think you are missing a whole lot of detail ! Explain again?
 
Why have you linked the CodID to both the origin and the dest?

With that join in place, it will only match records where BOTH the origin and dest match the CodID... which would mean the origin and dest would have to be the same?

... also, which Flag is it you're wishing to update to True?
 
Currently i am using code
f is tbldataentry.origin
g is tbldataentry.dest
p = DLookup("flag", "tblCodes", "Cod_ID = " & f)
q = DLookup("flag", "tblCodes", "Cod_ID = " & g)

If (f = g) Then
MsgBox ("Origin and Destination cannot be same, Please Check")
Exit Sub
End If

If (p = -1 Or q = -1) Then
r = 1
Else
r = 0
End If

and updating value of r in flag of tbldataentry

Does it answers to your question?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom