Field required to be updated

  • Thread starter Thread starter ladybug via AccessMonster.com
  • Start date Start date
L

ladybug via AccessMonster.com

I have an "hours" field that is currently set to a default of 0. I want this
field to be required to be updated if another field (named Task) is updated.
The field hours cannot equal 0 if a task is selected.

Anyone have any ideas?
 
You can do that when the data is entered through the form.

Use the BeforeUpdate event of the form to check the values of the fields, if
the time is not entered then prompt a message a stop the process

If Not IsNull(Me.[Task]) And (IsNull(Me.[hours]) Or Me.[hours] = 0 ) then
MsgBox "Field hours must be updated"
Cancel = True ' will stop the process
End If
 
That worked wonderfully. Thank you so much!

Ofer said:
You can do that when the data is entered through the form.

Use the BeforeUpdate event of the form to check the values of the fields, if
the time is not entered then prompt a message a stop the process

If Not IsNull(Me.[Task]) And (IsNull(Me.[hours]) Or Me.[hours] = 0 ) then
MsgBox "Field hours must be updated"
Cancel = True ' will stop the process
End If
I have an "hours" field that is currently set to a default of 0. I want this
field to be required to be updated if another field (named Task) is updated.
The field hours cannot equal 0 if a task is selected.

Anyone have any ideas?
 
Back
Top