Keep getting this massage, "Compile Error: Argument Not Optional" and highlighted Me.txtSiteType
Trying to figure up, but failed.
Please help.
Thanks in advance,
Trying to figure up, but failed.
Please help.
Code:
Private Sub cmdAdd_Click()
'when we click on button add there are 2 option
'1. for insert
'2. for update
If Me.txtSiteID.Tag & "" = "" Then
'this is for insert new
'Add data to table
CurrentDb.Execute = "INSERT INTO contoh(Site ID, Site Name, Site Type) " & _
" VALUES('" & Me.txtSiteID & "','" & Me.txtSiteName & "','" & Me.txtSiteType & "') "
Set Data = cmdAdd_Click()
MsgBox "Already Add"
End If
End Sub
Thanks in advance,
Comment