Deleting a field from within a Form

David Ball

Registered User.
Local time
Tomorrow, 07:34
Joined
Aug 9, 2010
Messages
230
Hi,
How do I delete a field in a form? If I have a continuous form can I have a button beside each record that deletes the value of a particular field if pressed? How does the code know which field to delete? What would the code on the button’s On Click event look like?

Thanks very much
Dave
 
I don't understand. A single field/control?

controlname = null


the form knows which row is active, so there is no issue.
 
It's not a control I'm trying to clear. I have two fields displayed for each record (row) in my Form, ItemID and ItemDecsription. I want to be able to delete (or clear?) the contents of ItemDescription by clicking a command button.

Also. I'm not trying to delete the entire record (row), just one of the fields.

I'm not sure how to reference the ItemDescription field or what any of the code would be?

Thanks

Dave
 
First, make sure that the field you are clearing is not required, and accepts zero length strings. Then, add your cmdButton and set the VBA On Click code like this:

Me.FieldName.Value = ""
 

Users who are viewing this thread

Back
Top Bottom