I have done coding in the student name box of this program under which when the cursor goes to this box and this box is empty then the message of "hello" should come but it is not coming.
I have done coding in the student name box of this program under which when the cursor goes to this box and this box is empty then the message of "hello" should come but it is not coming.
Looks like a continuation of this thread
https://www.accessforums.net/showthr...231#post516231
Try this:-
Private Sub Student_Name_GotFocus()
If (IsNull(Me.Student_Name)) Then
MsgBox "Enter a name", vbCritical
End If
End Sub
But can you also explain why you need to do this?
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
thanks.. it working
what was the difference between you coding and mine?
My main reason is other it's just a sample program...
That was another problem involving numeric and string problems which had been solved.Looks like a continuation of this thread
https://www.accessforums.net/showthr...231#post516231
This line:-
If (IsNull(Me.Student_Name)) Then
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
Well
= Null does not work
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
what is difference in this_____
if (IsNull(Me.Student_Name)) then
and
If (IsNull(Me![Student_Name].Value)) Then
and
If Me.Student_Name = "" Then
Please explain any expert......
.Value is the default property for a control so first two are the same.
Null is not = "" (already told you that), hat is called a Zero Length String (ZLS)
You could try
or test same for Length = 0Code:If Me.Control & "" = "" Then
Not an expert, but thought I'd have a punt.
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
The first two are quite similar but for the use of Me! vs Me.
Me! will not compile and will only evaluate at run time. If what follows ! cannot be resolved (e.g. due to a spelling error) it will only trigger an error when it tries to execute that line.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
thansk to all....