Another newbie question

M

Maggic

Hi again ... I'm mad at myself because I should be able to solve this myself
<sigh>

I have a date field on an input form called "DateEntered" defined as
date/time. What I want to do is save this date on one record, and be able
to use it again on later records as I see fit .. so you could have one
record with "DateEntered = 05/04/04" & say 10 records later want to plug the
field with a date entered earlier say "05/01/04". Now rather than re-key
the date I want to be able to automatically fill the field with "05/01/04"
and so on as records are entered ..

I defined a variable called "svdate" in the Global code module .. in the
general declarations area as "Public svdate as date"

I made a "date" command button with two event procedures ..

1. One for a single click of the mouse which has the following code:
"svdate = DateEntered" to load the date from the DateEntered field into the
save date field

2. The other for a double click of the mouse which has the following code:
"DateEntered" = svdate" to load the DateEntered field from the save date
field some records later.

I click the command button when I know I have a date that I will use later,
unfortunately nothing happens when I double click the button later to
re-load the date.

I changed the single click event procedure to load a date constant say
"5/1/4 "into the save date field "svdate" and when I double click the
command button it works i.e. I get "5/1/4" loaded into DateEntered.

I am obviously not doing something right, but I can't see it ... any help on
this would of course be much appreciated.

Maggic
ps apologies if I haven't used all the right terminology
 
M

Maggic

I think I have maybe sort of solved the problem .. the mouse double click
does not appear to work for some reason .. I created two command buttons,
one to save the date, and the other to re-load it, both events triggered by
a single mouse click & low and behold it works fine ... any ideas on why the
"double click" event doesn't work .. its Access 97 running on an old win95
system. My main system is w98 but access hangs on it when in design mode ..
and that's another problem, but lets not go there :)

Maggic
 
L

Larry Daugherty

Hi Maggic,

Pardon my misunderstanding your name in the other thread.

Given the problem solved in the other thread of saving the current values, I
question the utility of what you're trying to do. Putting two command
buttons on a form to just save and recall the date (which you could already
have saved via the other thread) sounds like overkill and more like a
learning/training exercise than something practical. If the current
implementation is insufficiently labor saving you could simply place the
cursor in the date field and CTRL-C to save it in the clipboard until you
need it, then CTRL-V to get it back. That's standard Windows functionality.

HTH
 
M

Maggic

Hi Larry .. you are right about the buttons being overkill, though I would
have liked the "double click " to have worked. It was also some what of a
training exercise for me, as I am pretty new to Access. Thank you for your
suggestion re: Cntrl-C & V .. have to admit that I didn't know that :(

Maggic
 

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

Similar Threads


Top