title: Passing data between two userforms doesn't work
body: <p>I am working on a userform that inserts data into a DB. There is a modify button that allows to update data but I want allow confirmation of update with a password. Therefore, in the Code of the modify button, I am calling another userform that prompts the user to enter a password. The problem I am having is that I have created a boolean variable that is set to <code>True</code> when the password is correct and to <code>False</code> other. When the password is correct, the code for the modify button continues but the <code>True</code> info is not transmitted to the first userform</p>
  
  <p>I have seen a lot of similar questions here but none of the answers that I have seen has helped me solve my problem. I have created some public variables in both codes but still does not work</p>
  
  <p>Here is the code for the modify button (First userform)</p>
  
  <pre><code>Private Sub modify_Click()
  On Error GoTo handler
  Dim connec As Object
  Dim rst As Object
  Dim stringconn As String
  Dim sqlupdt As String
  Dim modifmat As String
  Dim msg
  
  --Some code here
  
  if [condition] then
  goto 1
  end if
  
  1 password.show
  
  if pwcorr= True then 
  goto 2
  else
  msgbox "Incorrect password"
  exit sub
  end if
  
  3 --Some code here
  end sub
  </code></pre>
  
  <p>and here is the code for the password userform (2nd userform)</p>
  
  <pre><code>Public pwcorr
  public sub OkBtn_Click()
  Dim pw As String
  Dim pwin As String
  Dim pwcorr As Boolean
  
  pw= "abcde"
  pwin = Me.pwin.Text
  
  If pwin = vbNullString Then
  MsgBox "No password was entered", vbCritical
  ElseIf pwin = pw Then
  Me.pwcorr = True
  Unload Me
  Else
  MsgBox "Password incorrect", vbCritical
  End If
  End Sub
  </code></pre>
  
  <p>Whenever I get to the point where I check <code>If pwcorr = True</code> in the first code, the pwcorr is always empty. Don't know why</p>