Control Source unchanged

kit_sune

Registered User.
Local time
Today, 15:16
Joined
Aug 19, 2013
Messages
88
I'm working on a "login" form, I've borrowed the concept from another topic in this forum.

I'm using a Subform, visible = False when they start. A Listbox with names fed from Personnel_table displays all the users of my Database.

By clicking on a name, and then the "Login" button my VBA code sets the Password_Subform visible to True.

On this Subform I have a textbox called User_Text that displays the Name that was selected on the main form.

So far so good - the issue is this:

I allow the "Login" button from before to set the Subform back to invisible, just in case if the user made a mistake and clicked the button prematurely. However, if you select a new user name and click the Login button to bring the Subform back up, the User_Text text box does not update with the new name as I was expecting, it stays the same as it was before. Whatever I select before I click the login button the first time is what it stays at. The only way to change it is to go into design view/close the DB.

The User_Text Control Source is set as follows:

=[Forms]![TechSupportHub_Form]![Personnel_List]
Personnel_List is the name of my Listbox with the users who are selectable.
Should I do this a different way? Why will it not update?

Thanks!
~Kit
 
Last edited:
When you click the Login button to bring the Subform back up add this line of code at the end of the code where open or display the subform

Docmd.requery "Name of your subform"
 
Thank you very much, that did the trick!

I tried looking for some kind of requery statement, but I didn't realize it was a command.
 

Users who are viewing this thread

Back
Top Bottom