A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Store info for reports from switchboard



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2010, 10:50 PM posted to microsoft.public.access.gettingstarted
SoggyCashew
external usenet poster
 
Posts: 108
Default Store info for reports from switchboard

Hello, im running MS 2007 and I need help with my form 'frmSwitchboard'. On
my form I have buttons that open reports and some buttons require a
selection from a combo box
thats associated with that button. Now on the frmSwitchboard(s) button I am
using;

Me.Visible = False 'Hides the switchboard

So I can use the information when the report opens and when I close the
report I use;

Forms![frmSwitchboard].Visible = True

Which makes the frmSwitchboard visible again. My problem is if I open a
report and choose to just
close the DB all together I get the error;

Run-time error '2450':
cant find the form 'frmSwitchboard' refered to in a macro expression or
Visual Basic code.

But if I close the report then the DB everythings fine. Is there another way
besides using
the Me.Visible? If so can someone please explain how it could be acomplished
or give me a
sample or link to a sample. Thanks!
--
Thanks,
Chad
Ads
  #2  
Old June 1st, 2010, 11:23 PM posted to microsoft.public.access.gettingstarted
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Store info for reports from switchboard

Assuming it's the line in the report's Close event procedure that's raising
the error trap and ignore the error in the code:

Const FORMCLOSED = 2450

On Error Resume Next
Forms![frmSwitchboard].Visible = True
Select Case Err.Number
Case 0
' no error
Case FORMCLOSED
' anticipated error, so ignore
Case Else
'unknown error, so inform user
MsgBox Err.Description, vbExclamation, "Error"
End Select

Ken Sheridan
Stafford, England

SoggyCashew wrote:
Hello, im running MS 2007 and I need help with my form 'frmSwitchboard'. On
my form I have buttons that open reports and some buttons require a
selection from a combo box
thats associated with that button. Now on the frmSwitchboard(s) button I am
using;

Me.Visible = False 'Hides the switchboard

So I can use the information when the report opens and when I close the
report I use;

Forms![frmSwitchboard].Visible = True

Which makes the frmSwitchboard visible again. My problem is if I open a
report and choose to just
close the DB all together I get the error;

Run-time error '2450':
cant find the form 'frmSwitchboard' refered to in a macro expression or
Visual Basic code.

But if I close the report then the DB everythings fine. Is there another way
besides using
the Me.Visible? If so can someone please explain how it could be acomplished
or give me a
sample or link to a sample. Thanks!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/201006/1

  #3  
Old June 1st, 2010, 11:45 PM posted to microsoft.public.access.gettingstarted
SoggyCashew
external usenet poster
 
Posts: 108
Default Store info for reports from switchboard

Alan G answered it with code below.... Worked great!

If CurrentProject.AllForms("frmSwitchboard").IsLoaded Then
Forms![frmSwitchboard].Visible = True
End If

--
Thanks,
Chad


"SoggyCashew" wrote:

Hello, im running MS 2007 and I need help with my form 'frmSwitchboard'. On
my form I have buttons that open reports and some buttons require a
selection from a combo box
thats associated with that button. Now on the frmSwitchboard(s) button I am
using;

Me.Visible = False 'Hides the switchboard

So I can use the information when the report opens and when I close the
report I use;

Forms![frmSwitchboard].Visible = True

Which makes the frmSwitchboard visible again. My problem is if I open a
report and choose to just
close the DB all together I get the error;

Run-time error '2450':
cant find the form 'frmSwitchboard' refered to in a macro expression or
Visual Basic code.

But if I close the report then the DB everythings fine. Is there another way
besides using
the Me.Visible? If so can someone please explain how it could be acomplished
or give me a
sample or link to a sample. Thanks!
--
Thanks,
Chad

 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 OfficeFrustration.
The comments are property of their posters.