Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent subform from prompting for password on main form load

Status
Not open for further replies.

TreeKey

IS-IT--Management
May 28, 2013
2
0
0
US
Hi Everyone,

I have a main form and a subform. The subform pulls data from a password protected database, each user has their own username and password. I Have the subform set so that it is not visible on the load of the main form but a toggle button relveals it using vba code. The problem is that when I load the main form it prompts for the password to the subform database. I would like it to only prompt for the password when the toggle switch makes the form visible. If someone could please help I would appreciate it.

Thanks.
 
Thank you! That worked.

For anyone else running into this issue here is the code I used:

Private Sub Toggle84_GotFocus()
Me!frm_qry_mysubform.SourceObject = "frm_qry_myqry" 'sets source of subform to desired form
Me.frm_qry_mysecondsubform.Visible = False 'makes other subform invisible
Me.frm_qry_mysubform.Visible = True 'makes this form visible
End Sub

I have a set of toggle buttons on my main form and both forms are set to not visible by default.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top