Entering Year as part of a macro

  • Thread starter Thread starter SamDev
  • Start date Start date
S

SamDev

In a form I have a combo box that users can select a client. After selecting
a client the user clicks the OK button. The OK button I have set up the
event that it will run an append query and then a delete query. It appends
the selected client to a new a different table and then deletes selected
client from source table.

I want the user to be able to enter the year of the deletion (I have this
field in both original & destination tables), after the client is selected
and before the queries are run. A pop-up box would be nice. I can't seem to
figure out how to get Access to allow me to enter the year before it starts
running the queries.

Any help would be appreciated...much thanks!
 
I believe I understand what you are trying to do. Before you continue,
would you mind describing why? I ask because folks sometimes figure they
have to move records (or persons) from one table to another, and this is
rarely necessary.

Since you have dates involved, is there a chance you are working with
"archiving" information? If so, be aware that one way to archive is to
simply add a DateArchived field, then change the queries that look at that
table to exclude the "archived" rows. This gives the "current" rows.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
What you are suggesting is a good idea. Thanks!! But out of curiosity would
still like to know the answer my question - much thanks!!
 
Rather than a popup form, how about using the form you are working in? If
you add a field to hold the year (as a selection criterion for your
queries), you can refer to that form's field in your queries' selection
criteria, something like:

Forms!YourFormName!YourControlName

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
Sounds like a good idea - much thanks!!


Jeff Boyce said:
Rather than a popup form, how about using the form you are working in? If
you add a field to hold the year (as a selection criterion for your
queries), you can refer to that form's field in your queries' selection
criteria, something like:

Forms!YourFormName!YourControlName

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
Back
Top