My W10 pc cannot access a shared folder on the laptop when connected by wifi.
Go into the TCP/IPv4 advanced properties for the WiFi adapter then click the "WINS" tab. NetBIOS should be set to "Default" or "Enabled". If it's disabled then that could be the cause your problem.
...If I use the ip address rather than the laptop's name I can connect.......
If my tip above doesn't help then mapping the computer name to its IP address in the LMHOSTS file may help. The format will look like this: