Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's wrong?
Message
 
À
05/02/1999 06:23:38
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00184259
Message ID:
00184350
Vues:
22
>There is my code for a Search Button.. Is it somebody tell my why I receive a error message "End If without If" and VB highlight the End Sub line when I push on the button??
>
>I don't really know what is the problem.. Thanks!
>
>The sub SubUpdate need a parameter as recordset to run.
>
>Yannick Lepage
>
> Dim ok
>
> ok = False
>
> If cmdbutSearch.Caption = "&Search" Then
> puLoad = True
> SubSearch
> Else 'Bouton = &Update
> If Trim$(cmbRoomName.List(cmbRoomName.ListIndex)) = "NewCornelia Room" Then
> SubUpdate formData!dataNewCornelia.Recordset
> If Trim$(cmbRoomName.List(cmbRoomName.ListIndex)) = "Catalina Suite" Then
> SubUpdate formData!dataCatalina.Recordset
> ElseIf Trim$(cmbRoomName.List(cmbRoomName.ListIndex)) = "GreenWay Suite" Then
> SubUpdate formData!dataGreenWay.Recordset
> ElseIf Trim$(cmbRoomName.List(cmbRoomName.ListIndex)) = "Nautical Room" Then
> SubUpdate formData!dataNautical.Recordset
> ElseIf Trim$(cmbRoomName.List(cmbRoomName.ListIndex)) = "Quito Baquito Suite" Then
> SubUpdate formData!dataQuito.Recordset
> Else
> MsgBox "Please enter a room name.", vbOKOnly + vbCritical + vbExclamation, "Update Error"
> End If
> End If

The reason is that you have 3 IF and 2 endif.

I think that the line containing should be a ElseIf.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform