Solved

Report Designer

Posted on 2002-06-27
8
213 Views
Last Modified: 2013-12-03
I have a simple application for adding and updating Order information, using Access as the database.
I'm using DAO to add and update as I normally do (will get round to ADO one day), all works fine.

My experience wilth the report designer is limited but I have had no trouble creating what I want so far but I have some questions \ problems with them.

1) One Report lists all orders that are UnDespatched, very simple report and works fine, BUT the problem I have is when I close the report (after using .show) and update an order to Despatched, run the report again, it is the same as before, the Order that is now Despatched still shows, I have tride the refresh command.  It only works correctly when I exit the application and run it again.
When I use DAO I close the Recordset and Database using code, is there a way of making sure the reports do that??
I've also noticed the access.lockfile is always around now, whereas previously it is only there when updating the database.  (I can open it exclusivly though so it is not really locked out, report designer is set to lockreadonly)

2) I have been using SQL commands to retreive data and am aware of how to get data involving DATES, however, when using the SQL Builder to build the reports I have no idea where to start to put a date in.  I'd like a report to be generated that shows all UnDespatched orders for Today but I can't use Now or Date and as the date will always be changing I can't put a fixed one in, any ideas????

Thanks in advance

0
Comment
Question by:kitmax
8 Comments
 

Accepted Solution

by:
VBGuy91917 earned 100 total points
ID: 7113411
You might try the requery method on your recordset before opending your report again.  That basically re-runs the query that got you your recordset.  I'm not sure if that will, but see if that works.  The report designer can be a pain sometimes.

As for the 2nd question, I would create a variable that stores the date you want to pull records from and pass that to as SQL statement that you execute to get your data.  Example:


    dim dteMyDate as Date
    dteMyDate = Date  (or whatever you want to set it to)

    db.openrecordset( "SELECT * FROM rs WHERE UnDespatched = UnDespatched AND DespatchDate = #" & dteMyDate & "#")

Hope that helps a little.
0
 
LVL 1

Author Comment

by:kitmax
ID: 7114807
Thanks, I'll try the first point in the morning.

The 2nd point is a little more difficult (for me), I have used SQL by dates before....  

CriteriaDate = Format(frmStockReport.DTDate, "mm/dd/yyyy")
CriteriaDate = "#" & CriteriaDate & "#"
Set SkyRS = SkyDB.OpenRecordset("SELECT * FROM Stock WHERE Despatched = " & CriteriaDate & "")

But, how would it be done for a report, when I used the SQL builder in report designer it tells me it can't do dates, but does let me put an actual date in.  The reports are completly done in designer with no code by myself.
I've seen somewhere, sql statements for reports running in code, that would help.

Kit
0
 
LVL 1

Expert Comment

by:sksahir
ID: 7115050
hi kitmax
try out following
1) when u use  datareport1.show method before it use
   dataenvironment1.open method
2) and then go to datareport right click on report then  
   choose show code and from listing of datareport method
   choose unload method and type in that method
   dataenvironment1.close
it will solve your problem


sahir
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7115474
sksahir.

I suspect you hit the answer button in error.  If this is not the case, please re-read the EE Guidelines regarding locking questions with answers, especially when they do not even come close to answering the original question.

Anthony
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:kitmax
ID: 7115912
I have no requery methods, only refresh which does not work.

Also, there is no unload option on the report.

Kit
0
 
LVL 1

Author Comment

by:kitmax
ID: 7116035
OK, Thanks to you both so far, found out how to use the requery, close methods, also found this site which helped a little http://dbforums.com/archive/130/2001/06/4/82124

Any thoughts on the date issue, is it possible to create a query for a report during initialisation??

Thanks
Kit
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7964598
Hi kitmax,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept VBGuy91917's comment(s) as an answer.

kitmax, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 8014831
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now