I successfully use “Password Code” in one form, but when I try to use in in a different form I get “Error” on “Code Line Error”. It’s frustrating, and I can’t figure out why this is happening. Both are Main forms, not Sub Forms. Can anyone shed some light on this? Thanks.
*Password Code*
SUB Confirm_Password()
Dim oForm As Object
oForm = ThisComponent.Drawpage.Forms.getByName(“MainForm”)
oPassword = oForm.getByName(“Txt_Password”)
oConfirm = oForm.getByName(“Lbl_Confirm”)
Password = oPassword.Text
Confirm = oConfirm.Label
If Password = Confirm Then
ChangeFrm_Modify
Else
oPassword.Text = “”
msgbox (“Try again!”)
End If
End Sub
*Error*
BASIC runtime error.
An exception occurred
Type: com.sun.star.container.NoSuchElementException
Message: .
*Code Line Error*
oPassword = oForm.getByName(“Txt_Password”)