Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Selecting and Printing Specific Records

0 views
Skip to first unread message

HankL

unread,
Oct 31, 2009, 3:31:12 PM10/31/09
to
Access 2003

Is there a way that I can select specific records from a database to print
out specific columns for those records?
As an example, I have a database of restaurants. I want to select
certain restaurants in that database to print out on a sheet of paper for a
friend.

Thank you in advance for your support and suggestions,

HankL

Al Campagna

unread,
Oct 31, 2009, 4:05:00 PM10/31/09
to
HankL,
Many ways to do that...
If there's no "logical" restaurant selection for printing
(ex. by district, or by city, etc...) think about adding a PrintMe checkbox
field
to your restaurant table.
Set any restaurant record you want printed to chkPrintMe = True, and
have
the reports query use chkPrintMe = True as a criteria to filter the report.

Or use the OpenReport Where argument...
DoCmd.OpenReport "YourRpt", acViewPreview, , "chkPrintMe = True"

Note: you can create a couple of update queries that can run by button
to...
Set All chkPrintMe to False
Set All chkPrintMe to True
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"HankL" <hla...@bendbroadband.com> wrote in message
news:uQtV1CmW...@TK2MSFTNGP04.phx.gbl...

HankL

unread,
Nov 1, 2009, 10:24:12 PM11/1/09
to
Hello Al,

Thank you very much for your reply. I just want you to know, that I am a
novice at using Access. I am sorry but I cannot follow your suggestion in
setting up my Restaurant database to include PrintMe..
Your suggestion is an excellent idea and probably is exactly what I need to
be able to select certain restaurants to include on a list to print specific
fields.. 'I went into Design after opening the table and inserted a
checkbox column called PrintME
However I do not know how to 'Set any restaurant record I want printed to
'chkPrintME=True, and have the reports query use chkPrintMe=True as a
criteria to filter the report.'
I would appreciate step x step instructions as to how to accomplish this.
Also, can I just select certain fields such as Restaurant Name, Address,
Telephone number?I
I truly appreciate you taking the time to help me and please forgive my
lack of knowledge in being able to follow your original solution.

Thank you,

HankL

"Al Campagna" <newsg...@comcast.net> wrote in message
news:OaZruVmW...@TK2MSFTNGP05.phx.gbl...

Al Campagna

unread,
Nov 2, 2009, 9:49:08 AM11/2/09
to
Hank,
Sounds like you added a Boolean field named PrintMe (True/False) to
your Restaurant table.

Now, this checking/unchecking of PrintMe is best done using a continous
form, so
you can see as many Restaurants as possible, as you browse and check
PrintMe.
You can do Single Form, but you'll have to...
Find Record and check... find record and check... etc
which can be a bit time consuming.

OK... now make sure that PrintMe is included in the query behind your
form, and
add a check control to the form itself... and bind it (Control Source) to
the PrintMe field,
and name it chkPrintMe.

Just to get this going, use my second suggestion... (the better one for
several reasons).
On a button on your form... using it's OnClick event code...

Refresh


DoCmd.OpenReport "YourRpt", acViewPreview, , "chkPrintMe = True"

Let's see if we can just get to this point, and then we can move on to
other aspects of
this method.


--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"HankL" <hla...@bendbroadband.com> wrote in message

news:%23AG03v2...@TK2MSFTNGP06.phx.gbl...

Al Campagna

unread,
Nov 5, 2009, 8:24:01 AM11/5/09
to
Hank,
Other than a through Google web search (which yields 100s of hits), and
an Google Access Groups
search (below)...
http://tinyurl.com/ylav9jp
You'll have better luck if you create a new post for this particular
question.
Buried within an unrelated ongoing thread... not too many folks will see
it.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"HankL" <hla...@bendbroadband.com> wrote in message

news:egM$2LdXKH...@TK2MSFTNGP05.phx.gbl...
> Hi Al,
>
> Before I can continue with your suggestion, I ran into a problem when I
> attempted to do a Detect and Repair in Office 2003
>
> I keep getting the following message:
>
> ERROR 1919 configuring ODBC Data Source MS Access Database ODBC error 6
> component not found in registry
>
> I went to Microsoft site and found several solutions. I ran MDAC 2.8 and
> that did not work. According to the information it did not show VISTA as
> one of the O/S on their solution information
> I attempted to Import the ODBC from the registry from another computer on
> my
> home network and that failed. I have included an attachment of that error
> message.
>
> Any suggestions would certainly be appreciated if you could help me find a
> solution.
>
> Thanks,
>
> Hank


> "Al Campagna" <newsg...@comcast.net> wrote in message

> news:%23A%23xiu8W...@TK2MSFTNGP05.phx.gbl...

HankL

unread,
Nov 7, 2009, 7:44:10 PM11/7/09
to
Hi Al,

Actually I added a new field called PRINTME next to the name of the
restaurant in the table format. In Design View of my table, the data type
is YES/NO. I attempted to put a check mark next to several restaurants and
it accepts the check mark.

I am a little confused by several suggestions you made.

1) Now, this checking/unchecking of PrintMe is best done using a continuous
> form, I AM NOT SURE WHAT YOU MEAN BY USING A CONTINUOUS FORM. I assume it
> is like using the TABLE.
2) OK... now make sure that PrintMe is included in the query behind your


> form, and
> add a check control to the form itself... and bind it (Control Source) to
> the PrintMe field,

> and name it chkPrintMe. THIS NUMBER 2 IS A LITTLE CONFUSING TO ME AS
> WELL.

Basically, I am not sure if I should be setting this up in TABLE OR USE A
QUERY?

"Al Campagna" <newsg...@comcast.net> wrote in message

news:%23A%23xiu8W...@TK2MSFTNGP05.phx.gbl...

John W. Vinson

unread,
Nov 7, 2009, 9:06:55 PM11/7/09
to
On Sat, 7 Nov 2009 16:44:10 -0800, "HankL" <hla...@bendbroadband.com> wrote:

>Hi Al,
>
>Actually I added a new field called PRINTME next to the name of the
>restaurant in the table format. In Design View of my table, the data type
>is YES/NO. I attempted to put a check mark next to several restaurants and
>it accepts the check mark.
>
>I am a little confused by several suggestions you made.
>
>1) Now, this checking/unchecking of PrintMe is best done using a continuous
>> form, I AM NOT SURE WHAT YOU MEAN BY USING A CONTINUOUS FORM. I assume it
>> is like using the TABLE.
>2) OK... now make sure that PrintMe is included in the query behind your
>> form, and
>> add a check control to the form itself... and bind it (Control Source) to
>> the PrintMe field,
>> and name it chkPrintMe. THIS NUMBER 2 IS A LITTLE CONFUSING TO ME AS
>> WELL.
>
>Basically, I am not sure if I should be setting this up in TABLE OR USE A
>QUERY?

Neither.

Tables store data... under the hood, unexposed to user view or interaction.
Queries arrange, select and sort data... under the hood, unexposed to user
view or interaction.

In a professional database, users will essentially NEVER see a table or query
datasheet; all interaction with data should be via a Form.

A form can be in one of three "default views" - Single Form (showing one
record onscreen); Datasheet, showing what looks like a table or a spreadsheet;
or Continuous Form, showing controls like those on a single form (combo boxes,
textboxes, option groups, etc.) repeatedly.

Al's suggesting the latter.
--

John W. Vinson [MVP]

HankL

unread,
Nov 7, 2009, 10:08:54 PM11/7/09
to
Hello John,

Thanks for your response.

I am a novice using Access.

I do have a data base setup for Restaurants.
When I opened Forms it is in a single form view. I went into Design and
clicked on square were both rulers meet. I selected Continuous Forms and
saved it. However when I open the Forms it still shows it in a Single View.
Any suggestions to be able to see it in continuous view?

Thanks in advance for your support.

HankL
"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:un9cf51jah1fljf86...@4ax.com...

John W. Vinson

unread,
Nov 7, 2009, 10:50:25 PM11/7/09
to
On Sat, 7 Nov 2009 19:08:54 -0800, "HankL" <hla...@bendbroadband.com> wrote:

>When I opened Forms it is in a single form view. I went into Design and
>clicked on square were both rulers meet. I selected Continuous Forms and
>saved it. However when I open the Forms it still shows it in a Single View.
>Any suggestions to be able to see it in continuous view?

You probably need to rearrange the controls on the form. Drag the controls up
to the top edge of the detail area of the form, side by side - you can use one
or two rows if you wish, but if you want to see multiple records onscreen they
should occupy only a small vertical height. Then drag the bottom of the detail
area up to the bottom of the controls. Save the form; when you open it in data
view you should see mulitple records (as many records as fit the recordsource
criteria, anyway).

For an example take a look at the Orders form in the Northwind sample database
- the items ordered are in a continuous form.

HankL

unread,
Nov 8, 2009, 4:53:09 PM11/8/09
to
Hi John,

I attempted to rearrange the controls in Design View of the Form. That did
not change the appearance of the form. However, I now have a scroll bar on
the side of the form and allows me to scroll from one record to another in
alphabetical order. Could this also be considered as a Continuous Form?

If so, could you help me with the instructions as to how to setup a PRINTME
check box on the form so that I can select which record will be printed.

As an example I have 126 records in the Restaurant.mdb. database. Suppose I
only want to print out 8 of this restaurants on a single sheet of paper as a
report.

Also, I setup a dummy .mdb called Test.mdb. This was setup as a continuous
form from a table. The appearance is exactly as you describe in your
suggestion of the Northwest Sample Database. My Test database only has 3
fields.

I truly appreciate your assistance and support as I know it is time
consuming for you. I would really like to get this issue resolved so that I
can print out information from my Restaurant database as I need it.

HankL


"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message

news:8rfcf5d6i563cjtbs...@4ax.com...

John W. Vinson

unread,
Nov 8, 2009, 5:56:59 PM11/8/09
to
On Sun, 8 Nov 2009 13:53:09 -0800, "HankL" <hla...@bendbroadband.com> wrote:

>Hi John,
>
>I attempted to rearrange the controls in Design View of the Form. That did
>not change the appearance of the form. However, I now have a scroll bar on
>the side of the form and allows me to scroll from one record to another in
>alphabetical order. Could this also be considered as a Continuous Form?

It almost certainly is. You should be able to rearrange the controls on the
form to show more than one record at a time. However, since I cannot see your
form, do not know how the controls are arranged, and do not know what you have
tried - and since it's primarily a visual problem, not a text one - I'm rather
at a loss to describe how to do so, any better than I have already done! In
design view, have you shrunk the form window up to the bottom of the controls
so it's wide and short?

>If so, could you help me with the instructions as to how to setup a PRINTME
>check box on the form so that I can select which record will be printed.

You ***CANNOT*** set up a PRINTME checkbox ***ON A FORM*** to do this.

A Form does not store data. A checkbox on a form does not - by itself - store
data. You need more!

What you can do is to add a PrintMe Yes/No field ***TO YOUR TABLE***. Adjust
the form's Recordsource query, if necessary, to include this field, and put a
checkbox on the form.

>As an example I have 126 records in the Restaurant.mdb. database. Suppose I
>only want to print out 8 of this restaurants on a single sheet of paper as a
>report.

Using the form to edit the records, check whichever records you want to print.

Create a Query based on the table with a criterion of True on the field
Printme.

Create a Report (reports are for printing, forms are for onscreen display)
based on this query.

After you have printed the results, run an Update query updating the table
setting PrintMe back to False (so it won't keep printing the same eight
records over and over).

>Also, I setup a dummy .mdb called Test.mdb. This was setup as a continuous
>form from a table. The appearance is exactly as you describe in your
>suggestion of the Northwest Sample Database. My Test database only has 3
>fields.

Then fix your real form to resemble TEST.MDB. I don't know what you did
differently, presumably you do!

>I truly appreciate your assistance and support as I know it is time
>consuming for you. I would really like to get this issue resolved so that I
>can print out information from my Restaurant database as I need it.

HankL

unread,
Nov 9, 2009, 8:31:49 PM11/9/09
to
My forms are now in Continuous Form

I do have a PRINT ME checkbox field included in my Table. However, the
PRINT ME FIELD does not show on my FORM.
Thank you for your continued support,

Hank

John W. Vinson

unread,
Nov 9, 2009, 8:56:07 PM11/9/09
to
On Mon, 9 Nov 2009 17:37:21 -0800, "HankL" <hla...@bendbroadband.com> wrote:

>My forms are now in Continuous Form
>

>I do have a PRINTME checkbox field included in my TABLE. However, the
>PRINTME FIELD does not show on my FORM.

Open the Form in design view.
View its Properties.
Click the ... icon by the Recordsource property and open the recordsource in
query design view.
Add the PRINTME field to the Recordsource.
Use the toolbar or the field list to add a checkbox to the form bound to the
PRINTME field, or if there is a checkbox, set its Control Source property to
the name of the field.

>IPlease review the attached and perhaps with these pictures you can help me
>setup so that I can print SELECTED restaurants in a report
>
>I have some more .jpg pictures I want to send but I keep getting messages
>file is to large

Binary attachments are unwelcome and inappropriate in this text based
newsgroup.

>If you could send me your e-mail address I could send those picture directly
>via your e-mail

Sorry, I'm an unpaid volunteer donating my time on these newsgroups. To
control my time investment I must limit private email support to paying
customers.

John W. Vinson

unread,
Nov 9, 2009, 9:04:27 PM11/9/09
to
On Mon, 9 Nov 2009 17:43:33 -0800, "HankL" <hla...@bendbroadband.com> wrote:

>
>See attachment

Hank, *please do not attach pictures to newsgroup messages*.

This is a TEXT ONLY newsgroup. In point of fact, your pictures provide
absolutely nothing helpful to solving your problem. Posting a few lines of
SQL showing the Recordsource of your form would have taken up 500 bytes
instead of 50000, and provided useful information.

HankL

unread,
Nov 9, 2009, 9:45:53 PM11/9/09
to
Sorry John,

I was not aware that pictures was not permitted in newsgroups. In the
future I will not send any. Thanks for the information.
I misunderstood when the verbiage in your response seemed to me that if you
could see my forms or tables that it would give you a better indication of
my concerns.
Please except my apologies.

Hank


"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message

news:sdihf5h924v9vf7fs...@4ax.com...

Al Campagna

unread,
Nov 10, 2009, 9:07:00 AM11/10/09
to
Hank,
Have you added the new True/False field named PrintMe to
your form yet? (following John Vinson's instructions)

Even though you have set the form's Default View to Continuous,
because your form is large (vertically), you still may only see one
record at a time, on your screen.

So... for now... you'll need to go to a specific record, check the
PrintMe
to True, go to another record and set PrintMe to True, etc... etc... When
done printing, you'll need to go back and uncheck all the selected
restaurants.
*Don't be concerned by that right now. * We'll get the system working
"manually" to start, and then add conveniences later on.


--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"HankL" <hla...@bendbroadband.com> wrote in message

news:OCNls$aYKHA...@TK2MSFTNGP02.phx.gbl...

HankL

unread,
Nov 10, 2009, 9:26:46 AM11/10/09
to
John,

At the present time, I have the following setup:

1) A continuous form. I can see two records at one time and when I click on
the arrow it continues to scroll through my database
2) I have a PrintME yes/no checkbox on my table and it is on the form as
well. If I select the checkbox for YES in the table, it also puts a check
in the box on the form
3) I have set up a query
4) I have set up a report

Even if I put a check in various records and I open the report, I see all of
the 126 records rather than only the records with a check in the box

I believe that I am missing a step or filter in the query that will allow me
to only see the records I have checked off.

Please advise.

Thank you,

Hank


"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message

news:hpief5d06mud9ug45...@4ax.com...

HankL

unread,
Nov 10, 2009, 10:26:24 AM11/10/09
to
Hi Al,

This is where I am now


At the present time, I have the following setup:

1) A continuous form. I can see two records at one time and when I click on
the arrow it continues to scroll through my database
2) I have a PrintME yes/no checkbox on my table and it is on the form as
well. If I select the checkbox for YES in the table, it also puts a check
in the box on the form
3) I have set up a query
4) I have set up a report

Even if I put a check in various records and I open the report, I see all of
the 126 records rather than only the records with a check in the box

I believe that I am missing a step or filter in the query that will allow me
to only see the records I have checked off.

Please advise.

"Al Campagna" <newsg...@comcast.net> wrote in message
news:O78uT8gY...@TK2MSFTNGP02.phx.gbl...

John W. Vinson

unread,
Nov 10, 2009, 11:47:31 AM11/10/09
to
On Tue, 10 Nov 2009 06:26:46 -0800, "HankL" <hla...@bendbroadband.com> wrote:

>John,
>
>At the present time, I have the following setup:
>
>1) A continuous form. I can see two records at one time and when I click on
>the arrow it continues to scroll through my database
>2) I have a PrintME yes/no checkbox on my table and it is on the form as
>well. If I select the checkbox for YES in the table, it also puts a check
>in the box on the form
>3) I have set up a query
>4) I have set up a report
>
>Even if I put a check in various records and I open the report, I see all of
>the 126 records rather than only the records with a check in the box
>
>I believe that I am missing a step or filter in the query that will allow me
>to only see the records I have checked off.

The Query upon which the report is based is probably at fault. It should have
a criterion of True on the PrintME field.

If you're having trouble with the query, open it in design view; select
View... SQL; and copy and paste the SQL text to a message here.

HankL

unread,
Nov 10, 2009, 1:29:55 PM11/10/09
to
That did it. I can't tell you how much I appreciate your patience and
working with me to help setup my being able to select and print a report
just on the restaurants I need to print.
You have really given me a much better understanding of how Access works
using the databases.

John, I do have one more question. Is there a way that I could set up
something that after I print out the report I can select a button to delete
all of the check marks in my table at one time?

Many many thanks,

Hank


"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message

news:756jf51utupqgq7tm...@4ax.com...

Al Campagna

unread,
Nov 10, 2009, 2:48:25 PM11/10/09
to
Hank,
When I spoke of adding "conveniences" once we got the basic
system working... this is one of them.
You might want two buttons on your form...
One button named cmdPrintAll and another named cmdPrintNone

Create two "Update" queries against your Restaurant table.
cmdPrintAll - will run qryPrintAll , that sets the PrintMe for every
Restaurant record to
True.
cmdPrintNone - will run qryPrintNone , that sets the PrintMe for every
Restaurant record to
False.


--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"HankL" <hla...@bendbroadband.com> wrote in message

news:e8sfMPjY...@TK2MSFTNGP02.phx.gbl...

HankL

unread,
Nov 10, 2009, 5:25:56 PM11/10/09
to
Al,

I am a little lost as to how to create the two button on the form
I feel I do not know how to do the following and if you could give me step
by step instructions I certainly would appreciate it.
I don't want to screw up my present configuration because of lack of
knowledge

'Create two "Update" queries against your Restaurant table.

1) cmdPrintAll - will run qryPrintAll , that sets the PrintMe for every
Restaurant record to True.

2) cmdPrintNone - will run qryPrintNone , that sets the PrintMe for every
> Restaurant record to False.'

Are these steps to be done in the TABLE AS FIELDS or in the QUERY DESIGN
SECTION ?

Thank you,

Hank


"Al Campagna" <newsg...@comcast.net> wrote in message

news:uW8ZF7jY...@TK2MSFTNGP05.phx.gbl...

John Vinson

unread,
Nov 10, 2009, 10:25:09 PM11/10/09
to
"HankL" wrote:

> That did it. I can't tell you how much I appreciate your patience and
> working with me to help setup my being able to select and print a report
> just on the restaurants I need to print.
> You have really given me a much better understanding of how Access works
> using the databases.

You're most welcome! Glad you were able to get it worked out.

> John, I do have one more question. Is there a way that I could set up
> something that after I print out the report I can select a button to delete
> all of the check marks in my table at one time?

Yes. Create a Query in the query design window, qryResetPrint let's call it.
Base it on your table; select only the PrintMe field.

Put a criterion of True on the field. Change the query to an Update query
using the Query menu option. On the newly visible "Update To" line put False.

Save the query.

In your form, use the command button wizard to create a command button to
run this query (running a query will be one of the wizard options).

Al Campagna

unread,
Nov 10, 2009, 10:43:36 PM11/10/09
to

"HankL" <hla...@bendbroadband.com> wrote in message
news:eNWlFTlY...@TK2MSFTNGP05.phx.gbl...

Al Campagna

unread,
Nov 10, 2009, 11:02:32 PM11/10/09
to
Hank,
Well, you should know how to physically place two buttons on a form.
Each of those buttons will have an OnClick event.
That's where the code will go that will run the appropriate update
queries.

An Update query is a query one that alters data in a table, according to
user specified
criteria, with user defined values.

Go to Help, or any documentation you have, and read up on creating
Update
queries... how to create them, and how to use the query to alter values in a
table.
An Update query is an essential tool to know about.

qryPrintNone: Sets all PrintMe to False...
UPDATE tblRestaurant SET tblRestaurant.PrintMe = False;

qryPrintAll: Sets all PrintMe to True...
UPDATE tblRestaurant SET tblRestaurant.PrintMe = True;


--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"HankL" <hla...@bendbroadband.com> wrote in message

news:eNWlFTlY...@TK2MSFTNGP05.phx.gbl...

HankL

unread,
Nov 11, 2009, 11:47:28 PM11/11/09
to
John,

I followed your very explicit instructions.
I setup a new query called Reset Print
It shows Field as PrintMe
Table as Restaurant
Update to False
Criteria to True
In design view, I selected Control Wizards to make sure it was on
I then selected Command Button and placed it on the grid.
Beyond that nothing else came up from the Wizard to allow me to connect it
to run the query.
I may be entirely wrong, but I thought it would direct me to a macro builder
so that when I
selected the Command Button it would run the Reset Print Query

Please advise.

Thank you,

Hank
">

Al Campagna

unread,
Nov 12, 2009, 9:09:42 AM11/12/09
to
Hank,
Before going any further...
*Back up your tables!!*

The Update query sounds good... (ex. name qryResetPrint)
Now, you just have to run the query when the user Clicks the form's
cmdResetPrint button.

In form design, in the Properties dialog box for your cmdResetPrint
button...
Find the button's OnClick event.
(in Properties, make sure the ALL tab is selected)
Place your cursor in the blank text control on the right.
Using the little arrow on the right, select Event Procedure from
the drop down.
Click the little button on the right with 3 dots (...)
You are now in the form's Module, where VB code can be placed.
(This code will execute whenever you Click the cmdRestPrint
button)
You'll see this...
Private Sub cmdResetPrint_Click()

End Sub

Add this line between those...
Private Sub cmdResetPrint_Click()
DoCmd.OpenQuery "qryResetPrint"
End Sub

Now, when cmdResetPrint is clicked, the update query will run.


--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"HankL" <hla...@bendbroadband.com> wrote in message

news:ewSI%23M1YK...@TK2MSFTNGP02.phx.gbl...

HankL

unread,
Nov 12, 2009, 10:44:51 AM11/12/09
to
Good Morning Al,

I hope I did not screw up the Command Button. Yesterday, when I could not
get it to work, I deleted it and put in a new command button. I was not
aware that each time you put one in it gives it a new number such as Command
44 or Command 46.
When I opened up properties of Reset Print in form view I see the following:
Heading of the properties form is Command Button:Command46. However I
renamed the Command Button to 'Reset Print' in the Design View and that is
the name also in Form View.
I go to Event tab and on line that says: 'On Click, next to it is [Event
Procedure]
I then select the little box with the three dots and it opens VB
The heading in the top box say's Command46
The box next to it say's 'Click'
Just below there is a section that say's

Private Sub Command46_Click()
DoCmd.OpenQuery "qryResetPrint"
End Sub

After saving and going back to the form to make certain it works, I selected
the Reset Print Button and get the following error message in a Microsoft
Visual Basic dialog box:
Run-time error '7874'
Microsoft Office Access can't find the object'qryResetPrint.'

If I select the Debug button, it takes me back to the VB and highlights the
command, DoCmd.OpenQuery "qryResetPrint"

The actual name of my query is Query Reset Print and when I open the Query
in design view, the heading say's 'Query Reset Print: Update Query

Please advise.

Thank you,
Hank


"Al Campagna" <newsg...@comcast.net> wrote in message

news:e%23xWJH6Y...@TK2MSFTNGP06.phx.gbl...

Al Campagna

unread,
Nov 12, 2009, 1:46:42 PM11/12/09
to
HankL,
Whenever you get code from anyone on these newsgroups... always
make sure that you use the object names you have. Often the responder
is using "example" names, when none are directly specified.
You should avoid spaces in your object names, and make them as
descriptive
as needed.. Not a "rule", but a common practice.
Try renaming your query to qryUpdatePrintNone, and your button to
cmdUpdatePrintNone

Use those names in my code...
> Private Sub cmdUpdatePrintNone_Click()
> DoCmd.OpenQuery "qryUpdatePrintNone"
> End Sub

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"HankL" <hla...@bendbroadband.com> wrote in message

news:e07LV86Y...@TK2MSFTNGP05.phx.gbl...

HankL

unread,
Nov 14, 2009, 5:41:45 PM11/14/09
to
Al,

I renamed my Update query to qryUpdatePrintNone
I renamed my button to cmdUpdatePrintNone
In design view of my Update query, this is the following information"

Field: PrintMe
Table: Restaurant
Update To:False
Criteria: True

When I select the cmdUpdatePrintNone button and I have a checkmark in
PrintMe on my Restaurant form nothing happens. The checkmark remains in the
box.
I opened properties of cmdUpdatePrintNone button and it showed the
following:
Name of Dialog Box is Command Button: Command
On Click: [Event Procedure]
I selected the small box with the 3 dots and it opened VB Restaurant

This is what I saw that relates to the Command Button
_______________________________________________


Private Sub cmdUpdatePrintNone_Click()
DoCmd.OpenQuery "qryUpdatePrintNone"
End Sub

_______________________________________________

Private Sub Command47_Click()

End Sub
_________________________________
It seems the second box with Private Sub Command47_Click() comes on after I
clicked on the button in the Form View

Any further suggestions will be appreciated.

Thank you,

HankL


"Al Campagna" <newsg...@comcast.net> wrote in message

news:u58F7h8Y...@TK2MSFTNGP02.phx.gbl...

Al Campagna

unread,
Nov 15, 2009, 5:42:45 PM11/15/09
to
Hank,
Are you sure the name of your button is...
cmdUpdatePrintNone
Are you sure the query is named...
qryUpdatePrintNone
Are you sure you have the code attached to the
correct button name and correct event?

************* Important
What happens when you run the query from query design view.
(Query/Run)... (with several Restaurant records with PrintMe =True)
Does the query work from there?
*************

Even if there were no PrintMe set to True, the Update query
should come back with "Updating 0 Records." The fact that
you never got a message indicates that the query never ran.

Also, assuming you have your code on the correct control, and
on the correct event...
try this amended code...
Private Sub cmdUpdatePrintNone_Click()
Refresh


DoCmd.OpenQuery "qryUpdatePrintNone"
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"HankL" <hla...@bendbroadband.com> wrote in message

news:uA8YquXZ...@TK2MSFTNGP06.phx.gbl...
> Al,
>
> I renamed my Update query qryUpdatePrintNone

Al Campagna

unread,
Nov 17, 2009, 10:16:44 PM11/17/09
to
Hank,
Are you still out there?
Any success...

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"HankL" <hla...@bendbroadband.com> wrote in message

news:uA8YquXZ...@TK2MSFTNGP06.phx.gbl...

0 new messages