Hello-
I want my user to be able to add options to a listbox's underlying query/table. This is no problem, but I want a msgbox to appear if the value already exists. I know this is just a line or two of code but I can't seem to get it right. Here's a bit of what I have to add the record...
Thanks in advance!
I want my user to be able to add options to a listbox's underlying query/table. This is no problem, but I want a msgbox to appear if the value already exists. I know this is just a line or two of code but I can't seem to get it right. Here's a bit of what I have to add the record...
Code:
Else
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryAddNewMed"
MsgBox "Medicine has been added."
lstMedList.Requery
Me!txtNewMedName.Value = ""
txtNewMedName.SetFocus
End If