Forum Discussion
Tony2021
Dec 14, 2022Iron Contributor
REPLACE Function
Hello Experts, I have a find form (frmFind) and I have many subforms on this find form. I enter a number or text in txtFind on frmFind and if there is a hit, the subforms will show the data. I ha...
- Dec 14, 2022WHERE ((Replace(tblPmtProposalALL.Notes, ",", "") Like "*" & Nz([Forms]![frmFind]![txtFind],"") & "*"));
Tony2021
Dec 15, 2022Iron Contributor
Hi Tom, thanks for the response.
please see below my sql with the Replace function added. Let me know if you see any issues. I would expect to see a criteria (as I do in the other columns) in the query window but I am not sure.
WHERE (((tblPmtProposalALL.DDNo) Like "*" & Nz([Forms]![frmFind]![txtFind],"") & "*")) OR (((tblPmtProposalALL.Amount) Like "*" & Nz([Forms]![frmFind]![txtFind],"") & "*")) OR ((Replace(tblPmtProposalALL.Notes, ",", "") Like "*" & Nz([Forms]![frmFind]![txtFind],"") & "*")) OR (((tblBankAccounts.Beneficiary) Like "*" & Nz([Forms]![frmFind]![txtFind],"") & "*")) OR (((tblPmtProposalALL.Reference) Like "*" & Nz([Forms]![frmFind]![txtFind],"") & "*"));
thank you.
Tony2021
Dec 15, 2022Iron Contributor
Tom, just to confirm, is the REPLACE making a permanent change to the table data or is this only in the query and doesnt change the actual table data?
- Tom_van_StiphoutDec 15, 2022Iron ContributorThis is a SELECT query. They cannot update data in tables. We have UPDATE queries for that.
Of course you can try on a backup of your database.