Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

Database not working properly on another computer


(!)

bilotbear's Avatar
bilotbear bilotbear is offline
Junior Member with 2 posts.
THREAD STARTER
 
Join Date: May 2010
26-May-2010, 11:02 AM #1
Database not working properly on another computer
I recently made a simple database with Access 2007. Problem is that when I transferred the database to the user's laptop, my report generating code suddenly doesn't work. I copied that database to my flash drive to fix it on my computer but when I ran it, it works perfectly fine. This really puzzled me.

The report generating code goes something like:

str = "Select Table.Field1, Table.Field2....."

DoCmd.OpenReport "Reportname", acViewReport
Report![Reportname].Recordsource = str

The code works fine up to returning the str variable. I've checked and it returns the correct query. But then, the str query doesn't stick to the report's recordsource. The report opens up with it's original recordsource but what I need is the filtered recordsource that's supposed to be returned by the str query.

Any thoughts?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,610 posts.
 
Join Date: Mar 2005
Location: UK
27-May-2010, 12:21 PM #2
bilotbear, welcome to the Forum.

You would have had a much quicker response to your question if you has posted on the Business Applications Forum, as most Access/Excel programmers don't check this forum very often.
The best way to ensure that your Report gets the correctly filtered query is to use the Querydef function to replace the query that the Report uses with the filtered version.
__________________
OBP
I do not give up easily
bilotbear's Avatar
bilotbear bilotbear is offline
Junior Member with 2 posts.
THREAD STARTER
 
Join Date: May 2010
28-May-2010, 11:03 AM #3
Thanks OBP. I'll familiarize myself more with the thread categories here in Tech Support Guy as I search for more solutions.

About my problem. I found out that the query was working however, it wasn't being displayed on the report view. I accidentally found this out when I viewed the generated report in print preview. Even though the data in the report view was wrong, it appeared correct when I viewed it in print preview. So what I do now is ask the user to always view it in print preview after it was generated in report view.

It's just a work around though. I'll explore working with the Querydef just like you said.

But it still puzzles me why Access works this way. :/
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,610 posts.
 
Join Date: Mar 2005
Location: UK
28-May-2010, 01:01 PM #4
I am afraid Access and Access VBA are full of little surprises like that, but usually there is a work around.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Title Thread Starter Forum Replies Last Post
USB mouse not working properly? wytewidow Hardware 40 24-Sep-2009 04:25 AM
Wheel Mouse Optical USB not working properly sedempire Hardware 0 15-Sep-2009 07:46 PM
Solved: Flash not working properly. goku262002 All Other Software 10 17-Feb-2009 11:24 AM
Not getting any sound... But computer says my sound drive is working properly? hy0n Multimedia 2 29-Dec-2008 05:09 AM
(solved) Access: Database won't work right on another PC. hottesttotty Business Applications 6 06-Jan-2002 09:38 PM

WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑