|
-
Mar 23rd, 2000, 01:15 AM
#1
Thread Starter
Junior Member
I keep getting this error during an on exit event in a form created in Access2000. Does anyone know what this error is and how to correct it?
Thanks In Advance
-
Mar 23rd, 2000, 01:21 AM
#2
Lively Member
IF
It means you tried to put and END IF and it does not have a matching IF statement above it. Try matching your IF and END IF 's up.
-
Mar 23rd, 2000, 01:27 AM
#3
Thread Starter
Junior Member
Nias,
Thanks for answering so quickly. However it is the only If statement I have and there is an if with the end if yet I still get this error.
I am relatively new to VB and have never taken a formal class on the topic.
My Library is limited and I am trying to learn Access2000 at the same time. Last version used was Access 2.0.
Here is the Code I am running:
Public Sub Business_Status_Exit(Cancel As Integer)
If Business_Status = "Yes" Then Ma_Business_Info.show
End If
End Sub
What I want to do is have a new access form open if Business_Status is = "Yes" else to nothing. Can you still help?
Thanks again
-
Mar 23rd, 2000, 01:30 AM
#4
Lively Member
Try putting the code behind the THEN statement on a line by itself.
IF condition THEN
do this
ELSE
do that
END IF
-
Mar 23rd, 2000, 01:32 AM
#5
Lively Member
Change your code to look like this:
Public Sub Business_Status_Exit(Cancel As Integer)
If Business_Status = "Yes" Then
Ma_Business_Info.show
End If
End Sub
I think your problem is that VB does not want an End IF if the entire if statement is on one line.
You could also code it this way:
Public Sub Business_Status_Exit(Cancel As Integer)
If Business_Status = "Yes" Then Ma_Business_Info.show
End Sub
-
Mar 23rd, 2000, 01:42 AM
#6
Thread Starter
Junior Member
Thanks That was the problem.
It still doesn't work but that error is gone.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|