so, this is my code:
Private Sub Command8_Click()
Dim nameInput As String
Dim noomber As Variant
'Prevent Blank DB entrys.
If Not (Forms!frmInputLO.txtName = "") Then
Forms!frmInputLO.txtName.SetFocus
nameInput = Forms!frmInputLO.txtName
noomber = DLookup("name", "tblLOs", "name = nameInput") 'ERROR COMES ON THIS LINE
If Not (noomber = Null) Then
code...
Else
MsgBox "That Learning Objective already exists."
End If
Else
MsgBox "Please give the Learning Objective a name."
End If
End Sub
The goal of this is to check to see if a record already exists before adding a new one.
I'm pretty sure I'm using DLookup wrong, but I can not figure out how..
Thanks