E
endus
Hi,
I keep getting handed all sorts of Access related problems at work
despite the fact that I am not all that great with it, so I apologise
in advance if I am missing something obvious....I am trying to take
the opportunity to improve my knowledge of Access. The problem this
time is that I have a user who has an autokeys macro using sendkeys to
insert the current date. This key performs and needs to perform the
exact same function as CTRL+;. The problem is that sometimes
(supposedly after certain windows updates are installed) this will
blow up and cause an error. Access will say something about "Setting
up Wizards" which will inevitably crash leaving the user with the
option of repairing office. Repairing office works but we obviously
need a better solution.
I would like to be able to deliver him a solution that's better than
"tell the users to use CTRL+;". I have read online that using
SendKeys is considered kludgy and may cause problems. I have been
trying to rewrite this in a better way, but I'm not sure if it's even
possible to do it. I have seen numerous ideas on USENET on how to do
exactly this, but it always seems to have to be tied to a specific
object (definite possible confusion here). What we (apparently) need
is something that can be cut and pasted between DB's to add the same
functionality to multiple (small) DB's.
I was thinking of creating a Module like the following...
Function InsertDate(FormName As Form)
FormName.Value = Format(Now(), "mm/dd/yyyy")
End Function
The only problem is how to pass the form name from the "Run Code"
section of the autokeys macro...there doesn't seem to me to be a way
to reference whatever form/control is currently selected....this needs
to be able to insert the date basically anywhere....just free form
insert the date whereever the cursor is.
Again, I may be making huge blunders or just not understanding exactly
how all this stuff is laid out and works, but that's why I'm posting
here.
Big TIA.
~ endus ~~ at ~ endus ~ dot ~~ com ~
But what the hell. It is a good & healthy thing
to have a fine fat steak & a bottle of good Kentucky
bourbon & order cameras from Hong Kong & generally
feel rich. - Hunter S. Thompson
I keep getting handed all sorts of Access related problems at work
despite the fact that I am not all that great with it, so I apologise
in advance if I am missing something obvious....I am trying to take
the opportunity to improve my knowledge of Access. The problem this
time is that I have a user who has an autokeys macro using sendkeys to
insert the current date. This key performs and needs to perform the
exact same function as CTRL+;. The problem is that sometimes
(supposedly after certain windows updates are installed) this will
blow up and cause an error. Access will say something about "Setting
up Wizards" which will inevitably crash leaving the user with the
option of repairing office. Repairing office works but we obviously
need a better solution.
I would like to be able to deliver him a solution that's better than
"tell the users to use CTRL+;". I have read online that using
SendKeys is considered kludgy and may cause problems. I have been
trying to rewrite this in a better way, but I'm not sure if it's even
possible to do it. I have seen numerous ideas on USENET on how to do
exactly this, but it always seems to have to be tied to a specific
object (definite possible confusion here). What we (apparently) need
is something that can be cut and pasted between DB's to add the same
functionality to multiple (small) DB's.
I was thinking of creating a Module like the following...
Function InsertDate(FormName As Form)
FormName.Value = Format(Now(), "mm/dd/yyyy")
End Function
The only problem is how to pass the form name from the "Run Code"
section of the autokeys macro...there doesn't seem to me to be a way
to reference whatever form/control is currently selected....this needs
to be able to insert the date basically anywhere....just free form
insert the date whereever the cursor is.
Again, I may be making huge blunders or just not understanding exactly
how all this stuff is laid out and works, but that's why I'm posting
here.
Big TIA.
~ endus ~~ at ~ endus ~ dot ~~ com ~
But what the hell. It is a good & healthy thing
to have a fine fat steak & a bottle of good Kentucky
bourbon & order cameras from Hong Kong & generally
feel rich. - Hunter S. Thompson