Need to clear date field

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!!!
 
K

Ken Snell [MVP]

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.
 
B

Bonnie

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!!!


.
 
K

Ken Snell [MVP]

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!!!


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top