Recording problems UR22

First understand that MIDI does not send sound! If your external KB produces audio, then you need to connect it to your interface with an audio cable into an audio input and create an audio track for it.

If you’re having problems recording MIDI You need to checked that the MIDI channel being used is correct? You can set the Cubase side to “Any” if you only have the one source.
Do you have thru/local on/off settings set properly on the KB as well as in Cubase?
Have you enabled the monitor (loudspeaker button) on the track in the case you are using the ext. KB to trigger a VSTi?