Need to clear date field

  • Thread starter Thread starter Bonnie
  • Start date Start date
B

Bonnie

Hi there. Using A02 on XP. Have a form with a button that
runs a macro. Macro copies the record, goes to new, and
paste appends. There are 6 date fields that I need to make
blank, remove the copied dates. I have the macro
GoToControl [Date1] then SendKeys {Backspace} (wait=yes).
When I run the macro, dates 2 and 4 don't clear. I can see
them get focus and blink but the date remains. The 4 other
date fields do clear.

First, what am I doing wrong? Second, is there something
better I should be doing to accomplish this?

Thanks bunches in advance for any help or advice!!!
 
SendKeys are too finicky to be relied upon ..... better to use SetValue
action to put specific values into controls. You can set a control's value
to Null to blank it out.

If you're macro currently isn't working for those two controls, my first
guess is that there is a macro or VBA code running on the AfterUpdate event
of the control that puts a value back into the control if it doesn't contain
one. Check the AfterUpdate event property for those two controls.
 
You are not only a vunderkind, you are vavoom fast! Thanks
SO much for the advice. I tried SetValue first but put
IsNull and Is Null in the expression and it didn't work.
Duh, just null and when the 'n' capitalizes, I know it
recognized it. Also, yessir, I had something at work on
the BeforeUpdate event on those 2 that didn't clear.
Thanks bucketloads!!!
-----Original Message-----
SendKeys are too finicky to be relied upon ..... better to use SetValue
action to put specific values into controls. You can set a control's value
to Null to blank it out.

If you're macro currently isn't working for those two controls, my first
guess is that there is a macro or VBA code running on the AfterUpdate event
of the control that puts a value back into the control if it doesn't contain
one. Check the AfterUpdate event property for those two controls.
--

Ken Snell
<MS ACCESS MVP>




Hi there. Using A02 on XP. Have a form with a button that
runs a macro. Macro copies the record, goes to new, and
paste appends. There are 6 date fields that I need to make
blank, remove the copied dates. I have the macro
GoToControl [Date1] then SendKeys {Backspace} (wait=yes).
When I run the macro, dates 2 and 4 don't clear. I can see
them get focus and blink but the date remains. The 4 other
date fields do clear.

First, what am I doing wrong? Second, is there something
better I should be doing to accomplish this?

Thanks bunches in advance for any help or advice!!!


.
 
You're welcome.

--

Ken Snell
<MS ACCESS MVP>

Bonnie said:
You are not only a vunderkind, you are vavoom fast! Thanks
SO much for the advice. I tried SetValue first but put
IsNull and Is Null in the expression and it didn't work.
Duh, just null and when the 'n' capitalizes, I know it
recognized it. Also, yessir, I had something at work on
the BeforeUpdate event on those 2 that didn't clear.
Thanks bucketloads!!!
-----Original Message-----
SendKeys are too finicky to be relied upon ..... better to use SetValue
action to put specific values into controls. You can set a control's value
to Null to blank it out.

If you're macro currently isn't working for those two controls, my first
guess is that there is a macro or VBA code running on the AfterUpdate event
of the control that puts a value back into the control if it doesn't contain
one. Check the AfterUpdate event property for those two controls.
--

Ken Snell
<MS ACCESS MVP>




Hi there. Using A02 on XP. Have a form with a button that
runs a macro. Macro copies the record, goes to new, and
paste appends. There are 6 date fields that I need to make
blank, remove the copied dates. I have the macro
GoToControl [Date1] then SendKeys {Backspace} (wait=yes).
When I run the macro, dates 2 and 4 don't clear. I can see
them get focus and blink but the date remains. The 4 other
date fields do clear.

First, what am I doing wrong? Second, is there something
better I should be doing to accomplish this?

Thanks bunches in advance for any help or advice!!!


.
 
Back
Top