said by JDmailNY:
Why does this command do [switchport mode access]. and why would I need to use it ?????
There are two types of switch port modes: access and trunk
Access ports are what you would typically plug a server, PC/laptop, printer, etc into. An access port is configured to be within a particular VLAN. Ethernet frames that exit an access port (i.e. towards the device plugged into the port) will have any VLAN headers/tags stripped. Ethernet frames that enter an access port will have a VLAN tag added to identify which VLAN the ethernet frame belongs to.
Trunk ports are what you would typically plug a router into for inter-VLAN routing, or another switch in order to "share" VLANs between switches. Unlike access ports, ethernet frames that exit a trunk port will maintain any VLAN headers/tags that are present so that the receiving device is able to appropriately handle the frame.
Using the "switchport mode access" command you are, as mentioned by others, forcing the port to be an access port, no exceptions. A device plugged into this port will only be able to communicate with other devices that are in the same VLAN.
Using the "switchport mode trunk" command you force the port to be a trunk.
By forcing the port into a particular configuration you will have predictable outcomes when you plug devices into those ports. Security wise its a good idea.