2
我得到一個錯誤,當我使用這個按鈕,因爲如果,給一個錯誤無效的使用null,有人可以解釋嗎?無效使用空Access-VBA
Sub Concluído_Click()
Dim novonome As String
Dim dataadmi As Date
Dim datanasc As Date
Dim Email As Hyperlink
Dim Cargo As String
Dim Categoria As String
Dim ingless As String
Dim inglesw As String
Dim coordeq As String
Dim relcli As String
Dim Java As String
Dim SQL As String
Dim PHP As String
Dim wserv As String
Dim Vendas As String
Dim dgraf As String
Set table = New ADODB.Recordset
With Form_Funcionários
**If Len(.Nome.value & "") = 0 Or _
ValornaColuna(.Nome.value, "Funcionários", "Nome") = True Then**
MsgBox "Campo Nome do Formulario encontra-se vazio ou ja existe! Por favor altere o seu valor!", vbOKOnly, "Campo Vazio"
End If
End With
HideAll
End Sub
Private Function ValornaColuna(ByVal value As String, ByVal formTable As String, ByVal formColumn As String) As Boolean
Dim valueToCompare As String
Dim C As Boolean
Set table = New ADODB.Recordset
table.Open formTable, CurrentProject.Connection, adOpenDynamic, adLockReadOnly
C = False
While table.EOF = False And ExistsInColumn = False
valueToCompare = table.Fields(formColumn)
If StrComp(valueToCompare, value, vbTextCompare) = 0 Then
C = True
End If
table.MoveNext
Wend
table.Close
End Function