Before_update

  • Thread starter Thread starter dale
  • Start date Start date
D

dale

Is there a way to blank a field out in a before update. I have a field
that I am checking in code to make sure it has not been used already in
the table. If it is I am displaying a message and then want to blank out
whatever the user inputted. I have everything working the way I want
except getting the field blanked out. I am currently doing this in the
before_update function. If this is not the right place let me know.
 
I believe you can input

Me.YourFieldName.Undo


| Is there a way to blank a field out in a before update. I have a field
| that I am checking in code to make sure it has not been used already in
| the table. If it is I am displaying a message and then want to blank out
| whatever the user inputted. I have everything working the way I want
| except getting the field blanked out. I am currently doing this in the
| before_update function. If this is not the right place let me know.
|
 
Sarah said:
Yeah, but try

Me!YourFieldName.Undo YourFieldName is not a property of Me.

Actually it is. Fields and Controls are treated as properties of a
form/report.
 
I have tried both Me!Fieldname.Undo and Me.Fieldname.Undo neither work.

If I try Me.Fieldname.Undo I get a compile error. If I try
Me!Fieldname.Undo I get object doesn't support this property or method

Dale
 
This may be a stupid question but did you actually put in

Fieldname
or
the actual name of the field

I typed YourFieldName because I didn't know what the field's name is.

Debbie

|I have tried both Me!Fieldname.Undo and Me.Fieldname.Undo neither work.
|
| If I try Me.Fieldname.Undo I get a compile error. If I try
| Me!Fieldname.Undo I get object doesn't support this property or method
|
| Dale
|
| Rick Brandt wrote:
| > Sarah wrote:
| >
| >>Yeah, but try
| >>
| >>Me!YourFieldName.Undo YourFieldName is not a property of Me.
| >
| >
| > Actually it is. Fields and Controls are treated as properties of a
| > form/report.
| >
|
 
Debbie,

Disregard about the fieldname. I had used the label not the textfield.
The code is in place but it does not actually undo the field. If I type
142 into the textbox it goes through my code and displays the message
about a duplicate number. Then it does the undo. and returns to the
screen and the 142 is still there. Any ideas?

Dale
 
Back
Top