Conditional input

B

Bonnie43

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
 
F

fredg

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

Code the [qty rejected] control's AfterUpdate event:

MsgBox "The DMR number field must be filled in!"
[DMRNumber].SetFocus
 
B

Bonnie43

fredg: thanks for the response. It is working great, but one more thing. I
don't want them to be able to exit the form until the DMR field is filled in,
how do I write code for this?

fredg said:
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

Code the [qty rejected] control's AfterUpdate event:

MsgBox "The DMR number field must be filled in!"
[DMRNumber].SetFocus
 
V

Van T. Dinh

Use the Form_BeforeUpdate Event to make sure that there is a valid value in
"DMR Number" if there is a value in "qty rejected".

Check Access VB Help on the BeforeUpdate Event of a Form.

HTH
Van T. Dinh
MVP (Access)
 
Top