Need Help Solving Problem With Code LCD and Keypad Interface

I recently purchased a 4x4 matrix keypad, wrote some code for just that, worked perfectly, so now i wrote program that will take an input from the keypad and print it on an I2C lcd, then you press one of the A, B, C, D buttons on the keypad and it will store the entered number to a variable, press the ‘#’ key and it switches to “recall mode” where if you press any of the letters it will print back the number stored in it. thats the way it is supposed to work at least, i am having a hard time tracking down the problem, it is probably something simple, usually is haha. what is happening is the entry works perfectly, i enter the number and press letter A it echos back the number entered (from the variable it was stored to) and writes that the number was stored. however when i push the ‘#’ sign for recall mode it will say recall mode but it still behaves as if it is still in entry mode, and it will not print out the numbers that were stored. any help would be much appriciated, code is posted below:

#include <Keypad.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>

LiquidCrystal_I2C lcd(0x27,20,4);

String inNumber;
String numberA;
String numberB;
String numberC;
String numberD;

int mode = 0;

char keypressed;
const byte rows = 4;
const byte cols = 4;
char keys[rows][cols] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

//Code that shows the the keypad connections to the arduino terminals
byte rowPins[rows] = {9,8,7,6}; //Rows 0 to 3
byte colPins[cols]= {5,4,3,2}; //Columns 0 to 3

//initializes an instance of the Keypad class
Keypad myKeypad= Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);

void setup()
{
  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("LCD TEST");
  delay(1000);
  lcd.clear();
}
void recallMode()
{
  char recallModekeypressed = myKeypad.getKey();
  switch(recallModekeypressed)
  {
    case 'A':
      lcd.clear();
      lcd.setCursor(0,1);
      lcd.print(numberA);
      break;
    case 'B':
      lcd.clear();
      lcd.setCursor(0,1);
      lcd.print(numberB);
      break;
    case 'C':
      lcd.clear();
      lcd.setCursor(0,1);
      lcd.print(numberC);
      break;
    case 'D':
      lcd.clear();
      lcd.setCursor(0,1);
      lcd.print(numberD);
      break;
    case '#':
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Entry Mode");
      entryMode();
      break;
  }
}

void entryMode()
{
  keypressed = myKeypad.getKey();
  if (keypressed != NO_KEY)
  {
    lcd.print(keypressed);
    inNumber += keypressed;
  }
  switch(keypressed)
  {
    case 'A':
      inNumber = inNumber.substring(0, inNumber.length() - 1);
      lcd.setCursor(0,0);
      numberA = inNumber;
      lcd.setCursor(0,1);
      lcd.print(numberA);
      lcd.setCursor(0,2);
      lcd.print("Stored In Slot A");
      inNumber = "";
      break;
    case 'B':
      inNumber = inNumber.substring(0, inNumber.length() - 1);
      lcd.setCursor(0,0);
      numberB = inNumber;
      lcd.setCursor(0,1);
      lcd.print(numberB);
      lcd.setCursor(0,2);
      lcd.print("Stored In Slot B");
      inNumber = "";
      break;
    case '*':
      lcd.clear();
      lcd.setCursor(0,0);
      inNumber = "";
      break;
    case '#':
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Recall Mode");
      recallMode();
      break;
  }
}
void loop()
{
  entryMode();
}
void loop()
{
  entryMode();
}

This is your loop function. This is what will be called over and over. In your program, if you push the # key, it calls recallMode once. recallMode runs through but there hasn't been another key pressed yet. The getKey function doesn't wait for you to press a key. So it does nothing. Then the loop runs again and it only calls entryMode.

You could have a variable that you use to keep up with which mode you are in, and use that variable in the loop to decide which of those to call.

Problem solved, thank you, i was under the impression that getkey waited for a keypress and returned what key was pressed, i added the the mode integer equal to 0 and entry mode sets mode equal to 1 instead of calling the recall mode function. and i added an if statement to the loop function that simply checks if mode is equal to 1 and calls recall mode while it is 1 if not it calls the entryMode function. works perfectly