Solved

Report Designer

Posted on 2002-06-27
8
215 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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
 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 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

15 Experts available now in Live!

Get 1:1 Help Now