Hey guys.. i'm newbie in access, i just want to ask how to make validation data entry from the form entry using a VBA script.
so what i want to do is when i click the save button, if one of the textbox is empty.. the program will notify the user that the one of the field entry is empty and need to be filled
Here's what i got :
table "info" with fields: no,name,price
and what i got so far on my VBA code is like this:
Private Sub Command15_Click()
Set infodb = CurrentDb().OpenRecordset("info")
If Me!nametxt = "" Then MsgBox "write your name!"
Else
infodb.AddNew
infodb!no = me!infodb_txt
myrec.update
End Sub
and i keep getting message "ELSE without If" could u guys tell me the correct script?
Thx
so what i want to do is when i click the save button, if one of the textbox is empty.. the program will notify the user that the one of the field entry is empty and need to be filled
Here's what i got :
table "info" with fields: no,name,price
and what i got so far on my VBA code is like this:
Private Sub Command15_Click()
Set infodb = CurrentDb().OpenRecordset("info")
If Me!nametxt = "" Then MsgBox "write your name!"
Else
infodb.AddNew
infodb!no = me!infodb_txt
myrec.update
End Sub
and i keep getting message "ELSE without If" could u guys tell me the correct script?
Thx