title: MS Access Tag property - how its identifying update and insert operation?
body: <p>I trying to create Add,update,Delete operation on MS Access form.I found this code on internet where Insert and update is happening on the same button. I am not getting what is exactly happening in below line and how it's identifying it is for update or insert.</p>
  
  <p>Not getting following line : = Me.txtid.Tag &amp; "" = ""</p>
  
  <p>Please find below code which works perfect as per requirement.</p>
  
  <p>'When we click on button Add there are two options</p>
  
  <pre><code>'1. for insert
  '2. for update
  
  If Me.txtid.Tag &amp; "" = "" Then
      ' this is for insert new
      ' add data in table
  
  CurrentDb.Execute "insert into student(stdid,stdname,gender,phone,address)" &amp; _
      " values(" &amp; Me.txtid &amp; ",' " &amp; Me.txtname &amp; " ',' " &amp; Me.cmbgender &amp; " ','" &amp; _
       Me.txtphone &amp; "', '" &amp; Me.txtaddress &amp; "')"
   'refresh data in list on form
  subform_student.Form.Requery
  </code></pre>
  
  <p>Else</p>
  
  <pre><code>CurrentDb.Execute "UPDATE student " &amp; _
      " set stdid = " &amp; Me.txtid &amp; _
      ", stdname = '" &amp; Me.txtname &amp; "' " &amp; _
      ", gender = '" &amp; Me.cmbgender &amp; " ' " &amp; _
      ", phone = ' " &amp; Me.txtphone &amp; " ' " &amp; _
      ", address = ' " &amp; Me.txtphone &amp; " ' " &amp; _
      " WHERE stdid = " &amp; Me.txtid.Tag
  </code></pre>
  
  <p>End If</p>