|
-
Oct 27th, 2003, 06:38 AM
#1
Thread Starter
Addicted Member
Opening a Report reliably-Not my SQL statement?
It's in VBA (Access)
I have a report which grabs data off an open form *Through a query*
[Query grabs data off open form-report shows Querys data]
The problem is it doesn't always open, I get messages like:
access can't find the field FORMS reffered to in your expression
or
the open report action was cancelled.
The problem is, it seems to be totally random, it won't work, and then I'll reopen and it will/won't. There doesn't seem to be any way to 100% guarentee opening it,,,
and it needs to be.
The code I'm using:
VB Code:
'Checks if needed field is filled in
If not Datebox.Value >= "" Then
MsgBox "Please enter a Date"
Datebox.SetFocus
Else
'Checks if the form sale is the only open form
For Each frm In Forms
If frm.Name <> "frmsale" Then
DoCmd.Close acForm, frm.Name
End If
Next frm
'Hides the listbox, goes forward a record then
'backwards a record-to make sure the data is
'saved then re shows the listbox
List106.Visible = False
DoCmd.GoToRecord , , acNext
DoCmd.GoToRecord , , acPrevious
List106.Visible = True
'Opens report
DoCmd.OpenReport "qryreport", acViewPreview
PLEEEEEEEEEEASE Help, It's been driving me mad for a week or longer now!
Last edited by Bazzlad; Oct 28th, 2003 at 08:25 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|