title: MS Access Form populating certain fields in an excel file
body: <p>I have the below code that takes certain fields from my MS Access (A small Hotel Reservation Database)form and populates defined cells in the said Excel file. </p>
  
  <pre><code>Dim objXLApp As Object
  Dim objXLBook As Object
  Set objXLApp = CreateObject("Excel.Application")
  Set objXLBook = objXLApp.Workbooks.Open("Y:\123files\File\Hotel Reservation.xls")
  objXLApp.Application.Visible = True
  
  objXLBook.ActiveSheet.Range("B2") = Me.GuestFirstName &amp; " " &amp; GuestLastName
  objXLBook.ActiveSheet.Range("C2") = Me.PhoneNumber
  objXLBook.ActiveSheet.Range("E2") = Me.cboCheckInDate
  objXLBook.ActiveSheet.Range("F2") = Me.cboCheckOutDate
  objXLBook.ActiveSheet.Range("H2") = Me.RoomType
  objXLBook.ActiveSheet.Range("I2") = Me.RoomNumber
  End Sub
  </code></pre>
  
  <p>Me.RoomType is a combo box with the row source being a 3 column query. When I run the code the excel file lists the first column in my query instead of the 2 column which is the one I need, how can I direct it to add the second column of my query instead of the first? Also, how can I move to the next line in the excel file when I switch to a new customers form in my Access file?</p>
  
  <p>Thanks</p>