Formatting field to force input

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello: I have two fields, called "qty rejected" and the other "DMR number".
Both of these are number fields. I want to write a code that when the qty
rejeted is filled in, a note pops up stating that there must be a DMR number
input. Would someone please help me? Seems simple enough, but I can't seem
to get it to respond.
Thanks
 
Hello: I have two fields, called "qty rejected" and the other "DMR number".
Both of these are number fields. I want to write a code that when the qty
rejeted is filled in, a note pops up stating that there must be a DMR number
input. Would someone please help me? Seems simple enough, but I can't seem
to get it to respond.
Thanks

Answered elsewhere.
Please do not multi-post. If you feel you must post the same question
to more than one newsgroup (and it's seldom necessary), cross-post by
adding each additional newsgroup in the To Newsgroups: box, separated
by a comma.
This way an answer in one newsgroup will be seen in each of the
others. More readers will see the response and learn, and less time
will be spent on duplicate answers.

See Netiquette at http://www.mvps.org/access

It's a great site to visit anyway.
 
Hi Bonnie

You should put the code behind your form's BeforeUpdate event. The code
should first check if a value is in [qty rejected]. If it is, then it
should check [DMR number]. If that is null, then cancel the update and show
a message. Something like this:

Private Sub Form_BeforeUpdate(Cancel as integer)
If Not IsNull([qty rejected]) then
If IsNull([DMR Number]) then
[Dmr number].SetFocus
Cancel = True
MsgBox "Please enter the DMR number"
End If
End If
End Sub
 
Back
Top