Print mailing labels and update date field

Print mailing labels and update date field

am 18.04.2008 12:43:01 von Dr Al

I have a project which requires the batch import of customer contact
information, print mailing labels for those customers who have their
date of first letter field in the database set to null, and update the
date of first letter field with the date the mailing labels are
printed.

I already have a query which checks the date of first letter field,
and returns those customers whose date of first letter field is null.
How do I setup to run the mailing labels based on this criteria and
update the date of first letter field in the process?

Thanks

Re: Print mailing labels and update date field

am 19.04.2008 02:44:32 von Harry Skelton

Dr Al wrote:
> I have a project which requires the batch import of customer contact
> information, print mailing labels for those customers who have their
> date of first letter field in the database set to null, and update the
> date of first letter field with the date the mailing labels are
> printed.

A single query can't do that. You could make a Macro to do that (not
resorting to VBA) where it runs the report based on the first query,
then runs an update query based on the first that sets the date.

2 lines of code...easy...

....or you can -=try=- to do it via VBA in a report...just add code to
currentdb.execute "UpdateQueryName" to the close event of the report.

Re: Print mailing labels and update date field

am 19.04.2008 14:53:06 von Dr Al

On Apr 18, 8:44=A0pm, Harry Skelton wrote:
> Dr Al wrote:
> > I have a project which requires the batch import of customer contact
> > information, print mailing labels for those customers who have their
> > date of first letter field in the database set to null, and update the
> > date of first letter field with the date the mailing labels are
> > printed.
>
> A single query can't do that. =A0You could make a Macro to do that (not
> resorting to VBA) where it runs the report based on the first query,
> then runs an update query based on the first that sets the date.
>
> 2 lines of code...easy...
>
> ...or you can -=3Dtry=3D- to do it via VBA in a report...just add code to
> currentdb.execute "UpdateQueryName" to the close event of the report.


Thanks, but could you be a little more specific! You said...easy...,
but I am not that familar with code!
Thanks

Re: Print mailing labels and update date field

am 20.04.2008 07:00:44 von Harry Skelton

Dr Al wrote:
> Thanks, but could you be a little more specific! You said...easy...,
> but I am not that familar with code!
> Thanks

#insert

As much as I would like to give specifics, I no longer run Access.
(Grew up and work with the hard core stuff now - MySQL). HOWEVER, if
memory serves me, you can go to Macros on the left side of the database
window and then create a new macro. It will be a data grid where you
specify (first) what type of function you want to do, then (second) what
the name of the report or query you need to run is called. Simple! Use
the combo box to select "OpenReport" (I think that is one of them) and
another, on another line, to run the update query.)

The first line of the macro would be to run your report.

The second line of the macro would be to run an update query.

(if you need, use a wizard to create your update query. Have the
date field updated with Now() [include the parentheses]. This will
update the field in question to todays date. Thus not Null.)

Save the macro with a name you can remember. Of course, all this
is dependent on you having the report working, and having query that
will update the date field with today's date.

Then run the macro when you want to do the report and update the
information. You can assign the macro to a button in a form if you
wish. Leave the wizards turned on and it will guide you on how to do that.

I'm sorry I can't get more specific than that. But with the cost of
software these days, I have resorted to Linux and OpenSource. (And
LOVING IT!)

I wish you luck.

Re: Print mailing labels and update date field

am 22.04.2008 02:35:08 von Dr Al

On Apr 20, 1:00=A0am, Harry Skelton wrote:
> Dr Al wrote:
> > Thanks, but could you be a little more specific! You said...easy...,
> > but I am not that familar with code!
> > Thanks
>
> #insert
>
> =A0 =A0 =A0As much as I would like to give specifics, I no longer run Acce=
ss.
> (Grew up and work with the hard core stuff now - MySQL). =A0HOWEVER, if
> memory serves me, you can go to Macros on the left side of the database
> window and then create a new macro. =A0It will be a data grid where you
> specify (first) what type of function you want to do, then (second) what
> the name of the report or query you need to run is called. Simple! =A0Use
> the combo box to select "OpenReport" (I think that is one of them) and
> another, on another line, to run the update query.)
>
> =A0 =A0 =A0The first line of the macro would be to run your report.
>
> =A0 =A0 =A0The second line of the macro would be to run an update query.
>
> =A0 =A0 (if you need, use a wizard to create your update query. Have the
> date field updated with Now() =A0[include the parentheses]. This will
> update the field in question to todays date. =A0Thus not Null.)
>
> =A0 =A0 =A0Save the macro with a name you can remember. =A0Of course, all =
this
> is dependent on you having the report working, and having query that
> will update the date field with today's date.
>
> =A0 =A0 =A0Then run the macro when you want to do the report and update th=
e
> information. =A0You can assign the macro to a button in a form if you
> wish. Leave the wizards turned on and it will guide you on how to do that.=

>
> =A0 =A0 I'm sorry I can't get more specific than that. =A0But with the cos=
t of
> software these days, I have resorted to Linux and OpenSource. (And
> LOVING IT!)
>
> =A0 =A0 I wish you luck.


Thanks, I'll give it a try.

Re: Print mailing labels and update date field

am 22.04.2008 16:49:56 von rick.bresin

Dr Al,

For what it's worth, when I do something like this I open a form based
on the select query and print my labels from there then in the onclose
event of the form I just run an update query to place a date in the
records I just processed.

Rick

Re: Print mailing labels and update date field

am 23.04.2008 01:46:50 von Dr Al

On Apr 22, 10:49=A0am, "Rick A.B." wrote:
> Dr Al,
>
> For what it's worth, when I do something like this I open a form based
> on the select query and print my labels from there then in the onclose
> event of the form I just run an update query to place a date in the
> records I just processed.
>
> Rick

Thanks everyone,

I got it working this morning.... I would not have gotten it done
without your help.

Thanks