When we tried to leave at 3;00 AM to catch our flight, I did not have the code with me to open the front gate of the parking lot. i assumed it would be automatic on the way out, and the code would only be needed on the way into the parking lot. We spent 25 minutes frantically trying to open the gate until we realized there was an emergency number posted on the front door of the hotel. The front door had locked behind us and prevented us from re-entering to retrieve the card with the code on it which I had left in our room . We called the B&B emergency number, they gave us the gate code, and we were able to leave, and made our flight on time, but we had a lot of anxiety during those 25 minutes when we felt that we were trapped in the parking lot.