Will an intel i3 3240 work on a z87 or z97 board?

Solution
No. You need a socket 1150 cpu to use Z87 or Z97 motherboards.
The i3 3240 is a socket 1155 cpu, so you need a socket 1155 motherboard. These motherboard are no longer being produced so availability is limited.