My Assistant
![]() ![]() |
|
|
Sep 27 2010, 01:24 PM
Post
#1
|
|
|
UtterAccess Addict Posts: 203 |
Hello,
I have absolutely no training in VBA, but I have a project on my lap through work that I'm trying to muddle through. I've been using tutorials & internet research to teach myself to use Access, & right now I'm trying to create a report that uses a form to run a parameter. I'm using code given in a Microsoft Access help article, but when I entered it, I tried to open the report & was brought back into VBA for a code error. I'm not sure if I am misinterpreting the article I'm using, or if there is perhaps a typo in the article, or what--with no knowledge of this code, I could have it one character off & would have no way to know the difference. I'm hoping someone here can take a look & see if anything jumps out at them? Thanks for your time & help, I appreciate it! (IMG:style_emoticons/default/smile.gif) Jess Code: Private Sub Report_Open(Cancel As Integer) 'Set public variable to true to indicate that the report 'is in the Open event blnReportOpenEvent = True 'Open Select Alpine Program Lookup DoCmd.OpenForm "Select Alpine Program Lookup", , , , , acDialog 'Cancel Report if User Clicked the Cancel Button If IsLoaded("Select Alpine Program Lookup") = False Then Cancel = True 'Set public variable to false to indicate that the 'Open event is completed blnReportOpenEvent = False End Sub |
|
|
|
Sep 27 2010, 01:32 PM
Post
#2
|
|
|
Access Wiki and Forums Moderator Posts: 48,021 From: SoCal, USA |
Hi Jess,
Could you tell us what is the error message you're getting and which line is highlighted when you debug the code? Thanks. |
|
|
|
Sep 27 2010, 01:37 PM
Post
#3
|
|
|
UtterAccess Addict Posts: 203 |
No problem!
The pop up dialog says, "Compile error: Sub or function not defined" The text IsLoaded is highlighted in gray when this comes up, as if I highlighted it to replace the text. Then, when I click OK in the pop up, the line Private Sub Report_Open(Cancel As Integer) is highlighted in yellow with a yellow arrow pointed at it. Thanks for your help & prompt response! (IMG:style_emoticons/default/smile.gif) Jess |
|
|
|
Sep 27 2010, 01:49 PM
Post
#4
|
|
|
Access Wiki and Forums Moderator Posts: 48,021 From: SoCal, USA |
Thanks. From the MS article where you copied that code, did they explain about the IsLoaded() function?
IsLoaded() is not a built-in function in Access. You will have to find the code for that function and also add it to your database. Hope that helps... |
|
|
|
Sep 27 2010, 01:54 PM
Post
#5
|
|
|
UtterAccess Addict Posts: 203 |
Whoops, looks like I solved the problem. I hadn't included a line in my Module, so when I corrected that, everything began to work properly. My mistake, so sorry!
Thanks anyways for your willingness to help, it's much appreciated! I'm sure I'll be back again soon, I usually am.... (IMG:style_emoticons/default/smile.gif) (IMG:style_emoticons/default/smile.gif) Jess |
|
|
|
Sep 27 2010, 01:55 PM
Post
#6
|
|
|
Access Wiki and Forums Moderator Posts: 48,021 From: SoCal, USA |
Hi Jess,
Glad to hear you got it sorted out. Good luck with your project. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 07:51 AM |