Hi Steve,
Thanks for your quick response. My programming skills are limited. (I have
done some small programs in Basic, DOS, many moons ago). I understand some
of the basic principles though. Not too familiar with SQL but a quick
learner.
Regarding my project. The records in my database contain about 12 fields.
Some data in the fields will remain the same like Name etc. However 3 fields
will change every time new data is entered. These are Datefield, Textfield,
Numberfield.
I need to see the prior 2 entries on my form. So I have created a form that
displays Name and other fields that remain the same. I then have 9 fields
visible on the form in 3 groups of 3. These are named CurrentDatefield,
CurrentTextfield, CurrentNumberfield, PreviousDatefield, PreviousTextfield,
Previous Numberfield, OldDatefield, OldTextfield and OldNumberfield.
When I open the form for a specific record there will be data in all 9 of
these field boxes (if I entered more than 3 times of course). I then want to
press a button called '"New Data Entry" (Got the button already on my form -
it just does not work).
This button should then delete contents in all 3 Old... fields, Move all 3
Previous... fields to the corresponding Old... Fields and move all 3
Current... fields to the corresponding Previous... fields. The 3 Current...
fields should then be empty so that I can enter new data in CurrentDate,
CurrentTextfield and CurrentNumberfield.
Hope this is not too confusing.
Steve Schapel said:
Rookie,
This could be done using an Update Query. The SQL view of such a query
woud look something like this...
UPDATE YourTable SET [OldDate]=[PreviousDate],
[PreviousDate]=[CurrentDate], [CurrentDate]=Null WHERE YourIdField =
[Forms]![YourForm]![YourIdField]
You can then use a macro with the OpenQuery action to run this update.
However, without knowing details of your project, I would suspect that
your wanting to do this is indicative of a design problem with your
table. If you are interested in reviewing this aspect, please post back
with details of what these date fields are all about.
--
Steve Schapel, Microsoft Access MVP
I have created a form in an Access database file. On this form I would like
to have a button that moves data from 1 field to another. I just cannot seem
to make my button work.
For example - I have 3 fields - Current Date, Previous Date and Old Date.
I would like to press my button that I named "new data entry" and this
should then do the following : Delete info in Old Date, Move info in Previous
Date to Old Date and Move info in Current Date to Previous date.
After pressing this button I would like to insert a new date into Current
Date.
Hope somebody can help me