Using Replace function with pipes, vba

mjdemaris

Working on it...
Local time
Today, 11:00
Joined
Jul 9, 2015
Messages
426
So I got this code from Northwind and it seemed to work fine until today, as I've been making some changes.
Code:
=Replace("Request#|","|",Nz([RequestID],"(New"))
What it is supposed to do (if I understand this right) is look up the RequestID from a table and display it, otherwise display (New).

It was working, but now it displays the next RequestID - which does not even exist! So, I am wondering what the pipes do and if this is actually looking up the ID correctly.

Thanks,
Mike
 
Run an update query,and use the replace function in the field.
 
Sorry Ranman, but I don't follow.

BTW, this code is in the Control Source property of a text box, used as a Header for a form.
 
That code is just replacing one string with another (requestID). It's not 'looking up' anything.
 
Nothing. It's just a placeholder character that gets replaced by the new string.
 
Ok. How do you think it could return a value (unique ID, autonumber, from table: Request) that does not even exist?

Unless...somehow that value is created on the form somewhere...hmmm.
 

Users who are viewing this thread

Back
Top Bottom