Q:

Error: Operations must use an updatable query

I Created a program which will check into a hotel and update the back-end.
I am having a problem connecting and changing the UserID on my Rooms Table.
Tables are :

Users:
UserID - PK, Auto Number
Username - Short Text
Password - Short Text

Rooms
RoomID - PK, Auto Number
Room_Number - Number
UserID - FK, Number

Updatable Query
PARAMETERS parUsername Short, parRoom_Number Short;
UPDATE Rooms SET UserID = (SELECT UserID FROM Users WHERE Username = [parUsername])
WHERE Room_Number=[parRoom_Number];

C# Code
Form1
MessageBox.Show("Login Successful");
Home home = new Home();
home.Show();
home.LabelText = this.txtUsername.Text;

Home Form
public string LabelText
        {
            get
            {
                return this.lblUsername.Text;
            }
            set
            {
                this.lblUsername.Text = value;
            }
        }

CheckIn Usercontrol
 Home home = new Home();
            try
            {
                string ConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + "/Hotel.accdb";
                using (var con = new OleDbConnection(ConnString))
                {
                    con.Open();
                    using (var cmd = new OleDbCommand())
                    {
                        cmd.Connection = con;
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.CommandText = "Query2";
                        cmd.Parameters.Add("parUsername", home.LabelText);
                        cmd.Parameters.Add("parRoom_Number", lbRooms.SelectedItem);
                        cmd.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

A:

Instead of using a sub-query, try this
PARAMETERS parUsername Text ( 255 ), parRoom_Number Long;
UPDATE Rooms, Users SET Rooms.UserID = Users.UserID
WHERE Rooms.Room_Number = [parRoom_Number] AND Users.Username = [parUsername];

