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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only