You can have the switch and the receptacle in the same box. You cannot however have the undercabinet lighting on the small appliance receptacle circuit. This is the one that you tapped into to get your power.
Jim, does this requirement apply also to cabinets not in the kitchen? We are installing cabinets at our entry way (think mud room even though it's not a separate room). And I'm thinking about wiring receptacles and a switch to the in-cabinet lights this way.You can have the switch and the receptacle in the same box. You cannot however have the undercabinet lighting on the small appliance receptacle circuit. This is the one that you tapped into to get your power.