K
kealaz
Hello,
I have this bit of code, and I'm not entirely sure of what it means, but was
told it was a good idea to use and have been using it.
' Force this record to be saved, if it hasn't been already.
If Me.Dirty Then Me.Dirty = False
When is it a good idea to use this, and when is it not?
I am using some code to validate my form fields, and I'm not sure if I'm
running into some conflict due to the code above.
For example, if I have this code in my Before Update......
If Len(Me.NameOfControl1.Value & "") = 0 Then
MsgBox "You must fill in data for 'name of control or data'!", _
vbOK, "Missing Data"
Cancel = True
Me.NameofControl1.SetFocus
It's saying don't save if the information is not entered. And then "If
Me.Dirty Then Me.Dirty = False" is saying to save.
Are these in conflict? OR am I missing something? If they are, what is a
good way to resolve this conflict?
Thanks for any and all help!!!
I have this bit of code, and I'm not entirely sure of what it means, but was
told it was a good idea to use and have been using it.
' Force this record to be saved, if it hasn't been already.
If Me.Dirty Then Me.Dirty = False
When is it a good idea to use this, and when is it not?
I am using some code to validate my form fields, and I'm not sure if I'm
running into some conflict due to the code above.
For example, if I have this code in my Before Update......
If Len(Me.NameOfControl1.Value & "") = 0 Then
MsgBox "You must fill in data for 'name of control or data'!", _
vbOK, "Missing Data"
Cancel = True
Me.NameofControl1.SetFocus
It's saying don't save if the information is not entered. And then "If
Me.Dirty Then Me.Dirty = False" is saying to save.
Are these in conflict? OR am I missing something? If they are, what is a
good way to resolve this conflict?
Thanks for any and all help!!!