alexfwalker81
Member
- Local time
- Today, 02:36
- Joined
- Feb 26, 2016
- Messages
- 100
I'm guessing that @alexfwalker81 is trying to remove completely some string in the field (ie replace with nothing), but the field in the table (new target) is Null rather than a zls.
Again guessing, but the answer is probably:
If Target is Null then you're really in trouble!Code:' ... strinput = Replace(strinput, .Fields("Target"), Nz(.Fields("new target"), vbNullString)) ' ...
Lightbulb moment.
In my 'Subs' table, the final row was Null and Null. Having quickly imported it from Excel, I didn't notice the blank row in Excel, or once uploaded. I've just deleted that row and it seems to work perfectly.
GPGeorge, I take your point in relation to simplification. I had to simplify my example table simply because the contents are commercially sensitive. Your point is correct in relation to strings being substrings of others, especially where I'm working with URLs. Now that I've got the framework set up correctly though, I can address that.
Thank you for your help and patience.