I have input boxes in access form. I want to limit entry of * in one of the input fields named "Name" anyway If * is found anywhere in anyform of data entry then it should show warning.
I have input boxes in access form. I want to limit entry of * in one of the input fields named "Name" anyway If * is found anywhere in anyform of data entry then it should show warning.
The best place to do input validation is the BeforeUpdate event of a control.
I am novice !
I am not able to do it.
Do you have *any* experience with VB or VBA?
Very little !!!
As with most things in Access, there are several way to do this depending on what you actually want to happen. Do you want to warn the user but let them enter the "*" anyway?
On Design > conditions >
Macro named: abc
Condition : [Name]="*"
Action: Msgbox
Message: * can not be entered.
But if I enter * after any text, symbol etc it didn't show up the warning. I want something more perfect as in my first post requirement.
I want to warn the user but let them do not enter the "*" anyway.
* has special meaning in Access, it may be interfering with your efforts.
You may, guessing, be able to use something like [*]????
RG: I want to warn the user when they enter the "*" anyway. The warning should appear if any number of time the user tries to enter * anyway.
Do you want the user to *have* to respond to the warning by pressing a button or something?
I think responding to the warning by pressing a button is better RG.
Try something like this in your control:
...replacing YourControlName with your control name of course.Code:Private Sub YourControlName_BeforeUpdate(Cancel As Integer) If InStr(Me.YourControlName, "*") Then MsgBox "You are using and asterisk '*'", vbCritical + vbOKOnly End If End Sub