when date = set date display welcome

murray83

Games Collector
Local time
Today, 01:24
Joined
Mar 31, 2017
Messages
827
this is the code

Code:
'shows welcome msg
If Me.txtWelcomeDate.Value = "04/07/2017" Then
MsgBox "Happy July 4th" & Me.txtUserLookup.Value
Else
MsgBox "Welcome" & Me.txtUserLookup.Value
End If

and it works fine apart for one thing it doesnet say the persons name which it gets from the txtuserlookup
any dieas on what i have done wrong:)
 
1. You don't need the .value,
MsgBox "Welcome" & Me.txtUserLookup
Should work IF there is a value in the box.

2. This "ME.control" works only inside a form, not in a query,nor module outside a form.
 
cheers will try that
 
well i did that and this is all i got ( see attached image )

this is still my code

Code:
'shows welcome msg
If Me.txtWelcomeDate.Value = "04/07/2017" Then
MsgBox "Happy July 4th" & Me.txtUserLookup
Else
MsgBox "Welcome" & Me.txtUserLookup
End If
 

Attachments

  • welcome_msg.png
    welcome_msg.png
    5.8 KB · Views: 61
Is your user lookup control definitely called txtUserLookup?
 
Try MsgBox Me.txtUserlookup and see what that shows you?

Do you have Option Explicit in your code modules?
 
Try MsgBox Me.txtUserlookup and see what that shows you?

Do you have Option Explicit in your code modules?

yes that worked it displayed my name

and yes it is called txtuserlookup see attached
 

Attachments

  • yes it is.png
    yes it is.png
    93.4 KB · Views: 62
So you placed that MsgBox Me.txtUserLookUp with the rest of your code in the same place?
I'd be putting a breakpoint at the if statement and ? the variables.

yes that worked it displayed my name

and yes it is called txtuserlookup see attached
 
I just click with the mouse and put a breakpoint on a line,(marked with a red dot) then clear it or all when done.
 

Users who are viewing this thread

Back
Top Bottom