Once printed, change status

  • Thread starter Thread starter Neil Hiorns
  • Start date Start date
N

Neil Hiorns

I have set-up a form using Access 2000 which contains a
number of customer addresses. I have a tick box, which
when selected (in Query, selected = True) means that
these selected customers will now appear on a label
report.

This works fine, however, the problem is that if I
selected 100 customers and then printed and now want to
select another 100, I firstly have to de-select the
original ones. As you can imagine this is a bit laborious.

Is there a way that I can change a flag so that once
printed it de-selects them and ideally updates another
field to say that it has been printed (and when)?
 
You could place this line of code into the Click Event Procedure of a
command button to reset the Yes/No field (IsPicked" in this example):

dbEngine(0)(0).Execute "UPDATE [MyTable] SET [IsPicked] = False WHERE
[IsPicked] = True;", dbFailOnError
 
This work fine.

I have another field that contains dates, how would I
code to insert today's date?
-----Original Message-----
You could place this line of code into the Click Event Procedure of a
command button to reset the Yes/No field (IsPicked" in this example):

dbEngine(0)(0).Execute "UPDATE [MyTable] SET [IsPicked] = False WHERE
[IsPicked] = True;", dbFailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Neil Hiorns said:
I have set-up a form using Access 2000 which contains a
number of customer addresses. I have a tick box, which
when selected (in Query, selected = True) means that
these selected customers will now appear on a label
report.

This works fine, however, the problem is that if I
selected 100 customers and then printed and now want to
select another 100, I firstly have to de-select the
original ones. As you can imagine this is a bit laborious.

Is there a way that I can change a flag so that once
printed it de-selects them and ideally updates another
field to say that it has been printed (and when)?


.
 
Execute this:
"UPDATE MyTable SET IsPicked = False, MyDate = Date() WHERE ...

For help with SQL statements:
1. Create a new query. No table.
2. Swith it to SQL View (View menu).
3. Paste in the SQL statement.
4. Switch to Design view.

You can now working within the familiar query design window.
After arranging things the way you need, switch back to SQL View and copy
what you see there into your code.

--
This work fine.

I have another field that contains dates, how would I
code to insert today's date?
-----Original Message-----
You could place this line of code into the Click Event Procedure of a
command button to reset the Yes/No field (IsPicked" in this example):

dbEngine(0)(0).Execute "UPDATE [MyTable] SET [IsPicked] = False WHERE
[IsPicked] = True;", dbFailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Neil Hiorns said:
I have set-up a form using Access 2000 which contains a
number of customer addresses. I have a tick box, which
when selected (in Query, selected = True) means that
these selected customers will now appear on a label
report.

This works fine, however, the problem is that if I
selected 100 customers and then printed and now want to
select another 100, I firstly have to de-select the
original ones. As you can imagine this is a bit laborious.

Is there a way that I can change a flag so that once
printed it de-selects them and ideally updates another
field to say that it has been printed (and when)?


.
 
Back
Top