$AdminID is undefined.
Something similar to this would do the trick
$_SESSION['AdminID'] = (isset($_SESSION['AdminID'])) ? $_SESSION['AdminID'] : $row->id;
(with this you're setting the session with the 'ID' value from the array $row which is from the mysql_query)
your php errors should have informed you about this.
additionally your method of verifying the user is a little ...less then perfect..
firstly, you should be using mysql_real_escape_string() to prevent mysql injection
secondly, granted the the passwords aren't instated by the script and are user confidential, you should be using some form of hash like md5() or sha1() with a salt to keep them private.. and away from malicious visitors.
thirdly, your query WHERE UserName='$UserName' and Password='$Password' you should only be selecting the hashed password where the username = $username, than compare the two (I've been told this is safer)
Take what you can from what I've done below, it by no means is the "right" way to do it, but it may be helpful
//start session
session_start();
//db connection include
include("inc/dbconn_open.php");
//errors on
error_reporting(E_ALL);
ini_set('display_errors', '1');
//escape username/password
$UserName = (isset($_POST['UserName'])) ? mysql_real_escape_string($_POST['UserName']) : '';
$Password = (isset($_POST['Password'])) ? mysql_real_escape_string($_POST['Password']) : '';
if (!empty($UserName)) {
$sql = "SELECT `AdminID`,`UserName`,`Password` FROM `admin` WHERE `UserName`='$UserName'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
//If hashed passwords match proceed login
if (sha1($Password) == $row['Password']) { //granted the password was sha1() before insertion into db
$_SESSION['AdminID'] = (isset($_SESSION['AdminID'])) ? $_SESSION['AdminID'] : $row['id'];
$_SESSION['AdminLogin'] = true;
$_SESSION['user'] = $UserName;
header ('Location: Main.php');
}
}