Home Foros Foro dudas Foro de Access ERROR 94, USO NO VALIDO DE NULL. – CODIGO

ERROR 94, USO NO VALIDO DE NULL. – CODIGO

Viendo 2 entradas - de la 1 a la 2 (de un total de 2)
  • Autor
    Entradas
  • #11836

    Armando Rodriguez
    Participante

    ANEXO EL CODIGO DE TODOS CONOCIDOS HASTA EN DONDE ME SALE UN MENSAKE DE ERROR 94. DEL CAPITULO:  CURSO VBA ACCESS.PRACTICAS III. VIDEO 21 DE VBA ACCESS …
    <table style=»border-collapse: collapse; width: 294pt;» border=»0″ width=»392″ cellspacing=»0″ cellpadding=»0″><colgroup><col style=»mso-width-source: userset; mso-width-alt: 14336; width: 294pt;» width=»392″ /> </colgroup>
    <tbody>
    <tr style=»height: 12.0pt;»>
    <td class=»xl66″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>Private Sub btn_enviar_Click()</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>DoCmd.SetWarnings False</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl65″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>     Dim instruccion As String</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl68″ style=»height: 12.0pt;» height=»16″>     instruccion = «INSERT INTO usuarios (nif,nombre,apellido,usuario,contrasena) VALUES (c_nif.value,c_nombre.value,c_apellido.value,c_usuario.value,c_contrasena.value)»</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl65″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 84.0pt;»>
    <td class=»xl69″ style=»height: 84.0pt;» height=»112″>    If Not IsNull(c_nif) And Not IsNull)(c_usuario) And Not IsNull(c_contrasena) Then</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>           DoCmd.RunSQL instruccion</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl65″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>          MsgBox «Los Registros han sido Guardados… Gracias¡»</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>          c_nif.Value = Null</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>          c_nombre.Value = Null</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>          c_apellido.Value = Null</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>          c_usuario.Value = Null</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>          c_contrasena.Value = Null</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>          c_nif.SetFocus</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>   Else</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>         If IsNull(c_nif) Then</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>                   c_nif.BackColr = vbRed</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>                   c_nif.SetFocus</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>         ElseIf IsNull(c_usuariuoI Then</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>                  c_usuaro.BackColor = vbRed</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>                  c_usuario.SetFocus</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>         ElseIf IsNull(c_contrasena) Then</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>                 c_contrasena.BackColor = vbRed</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>                 c_contrasena.SetFocus</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl67″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>         End if</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl63″ style=»height: 12.0pt;» height=»16″>   End If</td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl64″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″></td>
    </tr>
    <tr style=»height: 12.0pt;»>
    <td class=»xl66″ style=»height: 12.0pt; width: 294pt;» width=»392″ height=»16″>End Sub

    AGRADEZCO SUS COMENTARIOS ANTICIPADOS</td>
    </tr>
    </tbody>
    </table>

    #11837

    Armando Rodriguez
    Participante

    Private Sub btn_enviar_Click()
    DoCmd.SetWarnings False

    Dim instruccion As String
    instruccion = «INSERT INTO usuarios (nif,nombre,apellido,usuario,contrasena) VALUES (c_nif.value,c_nombre.value,c_apellido.value,c_usuario.value,c_contrasena.value)»

    If Not IsNull(c_nif) And Not IsNull)(c_usuario) And Not IsNull(c_contrasena) Then
    DoCmd.RunSQL instruccion

    MsgBox «Los Registros han sido Guardados… Gracias¡»

    c_nif.Value = Null
    c_nombre.Value = Null
    c_apellido.Value = Null
    c_usuario.Value = Null
    c_contrasena.Value = Null

    c_nif.SetFocus

    Else
    If IsNull(c_nif) Then
    c_nif.BackColr = vbRed
    c_nif.SetFocus

    ElseIf IsNull(c_usuariuoI Then
    c_usuaro.BackColor = vbRed
    c_usuario.SetFocus

    ElseIf IsNull(c_contrasena) Then
    c_contrasena.BackColor = vbRed
    c_contrasena.SetFocus
    End if

    End If

    End Sub

Viendo 2 entradas - de la 1 a la 2 (de un total de 2)
  • Debes estar registrado para responder a este debate.