Print button on a userform to amend a table

garsidep

New member
Local time
Today, 10:47
Joined
Jan 14, 2009
Messages
3
Hi All,

Any help on this problem would be very much appreciated.
I currently have an access form which sit on top of my data table. On the form I have a print button to print the record currently selected. In my data table I have a simple Yes/No field called Printed. What I want to know is, is there anyway that I could build an event procedure, so that when the recorded is printed by pressing the print button on my user form it will automatic update the Yes/No field for that record in my data table?

Thanks in advance
Phil
 
In the Print Button event procedure just add:

txtPrintedYesNo = True

Note you need the field thats being updated on the form, and name it: txtPrintedYesNo
 
Hi allan,

Thanks for your help on this issue. I've added the code you gave me and added the field to my form and re-named it like you said. Unfortunately I get a “this recordset is not updateable” error message. I didn’t mention that my form get’s the data from a query and not directly from my table could this affect it in any way?

Thanks,
Phil
 
If you cannot edit the data in a query/recordset, this list may help you identify why it is not updatable:

List originally created by Allen Browne

It has a GROUP BY clause. A Totals query is always read-only.

It has a TRANSFORM clause. A Crosstab query is always read-only.

It uses First(), Sum(), Max(), Count(), etc. in the SELECT clause. Queries that aggregate records are read-only.

It contains a DISTINCT predicate. Set Unique Values to No in the query's Properties.

It involves a UNION. Union queries are always read-only.

It has a subquery in the SELECT clause. Uncheck the Show box under your subquery, or use a domain aggregation function instead.

It uses JOINs of different directions on multiple tables in the FROM clause. Remove some tables.

The fields in a JOIN are not indexed correctly: there is no primary key or unique index on the JOINed fields.

The query's Recordset Type property is Snapshot. Set Recordset Type to "Dynaset" in the query's Properties.

The query is based on another query that is read-only (stacked query.)

Your permissions are read-only (Access security.)

The database is opened read-only, or the file attributes are read-only, or the database is on read-only media (e.g. CD-ROM, network drive without write privileges.)
 

Users who are viewing this thread

Back
Top Bottom