That question is asking about the visa you used the last time you entered the US, not the visa that gave you your current status. So if you entered with a B1 visa and then switched to F1 and then to H1B without leaving the US, you would write the B1 visa number.
One of the requirements for the I-485 is that your last entry to the US was legal. That's why they're concerned about the nonimmigrant visa number. People who entered legally without a visa, e.g. Canadians would leave that part blank.
Also make sure to include a copy of the visa that you used for that entry.
PD: Jan 2003 (EB3 rest of world)
I-485 Approved: July 2007
I am a layman, not a lawyer. What I write here is not official or professional legal advice. In addition, my answers on this forum are specific to the scenarios discussed in each thread and should not be generalized to other situations.