Navigation Form Subform Code issue

JohnnyBQue

Registered User.
Local time
Today, 01:05
Joined
Oct 31, 2014
Messages
25
OK guys and Gals here's my next installment of what has he done now...

Created a Nav form that works as it should ....to a point I have several tabs that connect to forms and they open as they should BUT I have this one form that I called "HOME" where a greeting message appears to the user once a successful login has been performed. My issue is part of my Greeting msg appears ONLY when you click the "HOME" tab button after the Nav form opens.

Now the code I'm using is as follows:
Private Sub Form_Load()
Me.txtWelcome = Forms![Navigation form]!txtUser.Value


If IsNull(DLookup("[UserName]", "tblUser", "[UserLogin] = '" & [txtWelcome] & "'")) Then
Me.welcome = "Greetings" & "..." & Me.txtWelcome
End If

End Sub
Now the code in RED I'm pulling a value from the MAIN form that is to appear in the sub-form "HOME"
again the problem is NOT that I'm getting the wrong data it's when it appears

When the Nav forms opens the "HOME" tab is a Darker shade of blue than the others and is the form that appears on the screen first like I mentioned earlier, BUT this maybe miss leading me to think that focus is place on this tab at this point .....Only to find out that the focus may be set ONLY when I click it for again that's when the other text data appears which is the "Me.txtWelcome" data (or users name) the "Greetings..." shows up when the form first opens like I want it to.

Oh one more thing the txt.User.value has data in it after the User successfully logs in. It shows this in the txtUser text box in the Main/Parent Nav form. AND I'm working on the "ELSE" I wouldn't think this was the issue that I'm seeing here now...

now can someone narrow my lack of knowledge to a more focused area...
 
One thing with Forms and SubForms is the SubForms load first, then the Parent Form. Seems kinda backwards, but this may help point to a solution.
 
Couldn't figure out the reason why....I'm blaming it on the navigation form.....but I did a work around using the "Detail area" not the subform area and got the results I wanted thanks all that helped.
 

Users who are viewing this thread

Back
Top Bottom