Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-20-2008, 10:06 AM
Novice
 
Join Date: Nov 2008
Posts: 1
Jane is on a distinguished road
Default dialog box errors in report

Hi, i have previously done this in earlier versions of Access and it has worked fine but now i am using Access 2007 it doesnt work

This is what i am trying to do.

Create a report and in the underlying query one of the fields relates to a dialog box. Previously i have put in code in the report properties 'on open' and 'on close' to load up the dialog box. The code i am using is shown below but it now errors saying 'illegal function'

'------------------------------------------------------------
' Report_Open
'
'------------------------------------------------------------
Private Sub Report_Open(Cancel As Integer)
On Error GoTo Report_Open_Err

' open form
DoCmd.OpenForm "dialogbox", acNormal, "", "", acEdit, acDialog
If (Not IsLoaded("dialogbox")) Then
DoCmd.CancelEvent
End If


Report_Open_Exit:
Exit Sub

Report_Open_Err:
MsgBox Error$
Resume Report_Open_Exit

End Sub

'------------------------------------------------------------
' Report_Close
'
'------------------------------------------------------------
Private Sub Report_Close()
On Error GoTo Report_Close_Err

' close form
DoCmd.Close acForm, "dialogbox"


Report_Close_Exit:
Exit Sub

Report_Close_Err:
MsgBox Error$
Resume Report_Close_Exit



End Sub

Please can you help me fix the code so it works in Access 2007

Many thanks
Jane
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub-report backcolor matching alternating row color in main report postman Reports 0 10-24-2008 09:20 AM
Access 2002 Front-End Inconsistent Errors janetb Security 1 07-28-2008 10:17 AM
Does not show ODBC Data Source Administrator dialog. ChanChanko Access 0 08-30-2006 12:50 AM
Errors when they prepare their reports at the same time admaldo Reports 11 03-16-2006 09:28 AM
Errors when they generate their reports at the same admaldo Security 1 03-11-2006 04:38 AM


All times are GMT -8. The time now is 02:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.