S
Steve Goodrich
I need to clear nearly all fields of a record without deleting the record
itself , (57 out of 60) I thought a command button on the form would be a
good Idea and save hitting the delete key 57 times.
Some fields are text, some fields are check boxes and one field is an OLE
Picture
I clear the text and check boxes by using the following code:
Check boxes
Me.L18 = False
Me.L18 = False
Me.L19 = False
Me.L20 = False
Me.L21 = False
Me.L22 = False
etc.
Text boxes
me. firstName = null
me.surname = null
etc.
I clear my ole picture field using
DoCmd.GoToControl "Picture"
DoCmd.RunCommand acCmdDelete
This works most of the time!
Sometimes (not all) if the record doesn't have a picture within the record,
I get the following message.
Run Time error 29013
This action will reset the current code in break mode. Do you want to stop
the running code?
To halt the execution of the program so the module window can be closed,
select yes. To leave the code in the current state, select no.
There are no options for Yes/No, There are 2 options, Debug and End, There
is a third option which is greyed out - Continue.
I click Debug and the last line of my code is highlighted
DoCmd.RunCommand acCmdDelete
If I do nothing and close the database down and re-open it, It works fine
again even when clearing records with no picture!!
The next time I use it I could get the error message again.
Can any one suggest a solution, or is there another way to clear the OLE
picture with my command button?
Thanks for any help
itself , (57 out of 60) I thought a command button on the form would be a
good Idea and save hitting the delete key 57 times.
Some fields are text, some fields are check boxes and one field is an OLE
Picture
I clear the text and check boxes by using the following code:
Check boxes
Me.L18 = False
Me.L18 = False
Me.L19 = False
Me.L20 = False
Me.L21 = False
Me.L22 = False
etc.
Text boxes
me. firstName = null
me.surname = null
etc.
I clear my ole picture field using
DoCmd.GoToControl "Picture"
DoCmd.RunCommand acCmdDelete
This works most of the time!
Sometimes (not all) if the record doesn't have a picture within the record,
I get the following message.
Run Time error 29013
This action will reset the current code in break mode. Do you want to stop
the running code?
To halt the execution of the program so the module window can be closed,
select yes. To leave the code in the current state, select no.
There are no options for Yes/No, There are 2 options, Debug and End, There
is a third option which is greyed out - Continue.
I click Debug and the last line of my code is highlighted
DoCmd.RunCommand acCmdDelete
If I do nothing and close the database down and re-open it, It works fine
again even when clearing records with no picture!!
The next time I use it I could get the error message again.
Can any one suggest a solution, or is there another way to clear the OLE
picture with my command button?
Thanks for any help