UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Inputbox Is Not Quite Sufficient, Access 2010    
 
   
JohnvanSomeren
post Dec 7 2017, 12:01 PM
Post#1



Posts: 641
Joined: 31-August 12
From: London, England


How do I write my own InputBox form which waits on the user?

In my system all ussers are logged on during the Open event of the Main Menu form. No user input was required until now. Now I want the users to select which branch they are working on during that session.

There is no form open at this time (the main menu hasn't displayed yet) and I could, if pushed, code this:
CODE
    If HomeBranch = "??" then
        strCurrentBranch = InputBox "What Branch ID?"
        '[add validation code here]
    else
        strCurrentBranch = HomeBranch
    end if

However I want users to select from a combo box. I built a form with only the combo box and an OK button. The OK button updated tblUsers with the selected current branch.

My code now says
CODE
    If HomeBranch = "??" then
        docmd.OpenForm "frmChangeBranch"
    else
        strCurrentBranch = HomeBranch
    end if


I honestly did not know that Access would not wait on the open form. It doesn't: it just opens the window and passes on to all the commands right down to the end sub.
Go to the top of the page
 

Posts in this topic



Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 04:16 PM