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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement