
Else without if
Publicado por rosy (12 intervenciones) el 09/03/2016 18:28:21
Hola Buen dia
Tengo este codigo pero al abrir mi formulario me aparece el error de "Else without if", si quito el else de (ElseIf Text48 = Combo30 Then) y solo dejo el If entonces solo me ejecuta la primer accion, me podrian ayudar por favor?
gracias
Tengo este codigo pero al abrir mi formulario me aparece el error de "Else without if", si quito el else de (ElseIf Text48 = Combo30 Then) y solo dejo el If entonces solo me ejecuta la primer accion, me podrian ayudar por favor?
gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Private Sub ser_afterUpdate()
If Not Ser.text = "" Then
Dim serint As Variant
Dim sqlquery As String
Dim Response As Integer
If Text48 <> Combo30 Then
Response = msgbox("Numero de Parte Incorrecto", vbyesNo, "Atencion")
If Response = vbYes Then
DoCmd.OpenForm "Login"
Else
DoCmd.CloseDatabase
ElseIf Text48 = Combo30 Then
serint = DLookup("Serial", "SerialesCreados", "Serial='" & Ser.text & "'")
If Not serint = "" Then
Ser.BackColor = RGB(255, 0, 0)
Beep
msgbox ("El Serial Existe")
Beep
Else
sqlquery = "Insert into SerialesCreados(Serial,Fecha) Values('" & Ser.text & "','" & Date & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL sqlquery
DoCmd.SetWarnings True
Ser.BackColor = RGB(0, 255, 0)
Ser.SetFocus
End If
End If
End If
End If
End Sub
Valora esta pregunta


0