Run Macro only if certain form is open

I have programed a maco to open one of various forms depending on criteria on 
an open form.  Is there a way to run a "follow up Macro" based on which form 
opens? In other words can I run a macro based on wheather a certain form is 
active?
-- 
Thanks,
Chuck
0
Utf
3/6/2008 12:39:08 AM
access.forms 6864 articles. 2 followers. Follow

4 Replies
2953 Views

Similar Articles

[PageSpeed] 5

Take a look at the RunMacro Method of the DoCmd object. You can have it as
part of the OnLoad of the form in question.

Chuck wrote:
>I have programed a maco to open one of various forms depending on criteria on 
>an open form.  Is there a way to run a "follow up Macro" based on which form 
>opens? In other words can I run a macro based on wheather a certain form is 
>active?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200803/1

0
StrayBullet
3/6/2008 1:01:52 AM
Thank you.  That makes sense.
-- 
Thanks,
Chuck


"StrayBullet via AccessMonster.com" wrote:

> Take a look at the RunMacro Method of the DoCmd object. You can have it as
> part of the OnLoad of the form in question.
> 
> Chuck wrote:
> >I have programed a maco to open one of various forms depending on criteria on 
> >an open form.  Is there a way to run a "follow up Macro" based on which form 
> >opens? In other words can I run a macro based on wheather a certain form is 
> >active?
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200803/1
> 
> 
0
Utf
3/6/2008 1:21:00 AM
Chuck,

You can use a Condition in your macro, like this:
[Screen].[ActiveForm].[Name]="whatever form"

-- 
Steve Schapel, Microsoft Access MVP

Chuck wrote:
> I have programed a maco to open one of various forms depending on criteria on 
> an open form.  Is there a way to run a "follow up Macro" based on which form 
> opens? In other words can I run a macro based on wheather a certain form is 
> active?
1
Steve
3/6/2008 2:25:30 AM
That is exactly what I needed.
-- 
Thanks,
Chuck


"Steve Schapel" wrote:

> Chuck,
> 
> You can use a Condition in your macro, like this:
> [Screen].[ActiveForm].[Name]="whatever form"
> 
> -- 
> Steve Schapel, Microsoft Access MVP
> 
> Chuck wrote:
> > I have programed a maco to open one of various forms depending on criteria on 
> > an open form.  Is there a way to run a "follow up Macro" based on which form 
> > opens? In other words can I run a macro based on wheather a certain form is 
> > active?
> 
0
Utf
3/6/2008 4:37:01 PM
Reply:

Similar Artilces:

a macro help
I am looking for a macro,when I select a sheet name from the list,copy that sheet datarange a1:d1000 and h30:k50 and paste or load to this sheet.when I select another sheet that sheet data range a1:d1000 and h30:k50should replace existing old data. ...

SQL Agent not able to open the outlook
Hello, I have one user called as SQL Agent which also act as Serivce Account for SQl. I am able to create outprofile for this user however when i try to open the outlook i am getting this error "Unable to open your default e-mail folders. The attempt to log on to the Microsoft Exchange Server computer has failed." I am able to login throuhg OWA, Tried on different outlook versions. Even under Exchange System Manager => Mailbox store => Logons => Under this i am able to see 32 times the SQL Agent. Any help would be really appreciated. Thanks in advance Did you creat...

Controling READ ONLY and READ/WRITE mode when opening a project PS
Hello All, I was looking for a way to force users to select between READ ONLY and READ/WRITE instead of it defaulting to READ/WRITE when opening projects in MS Project 2007. Any suggestions would be a huge help. Thanks, Eric Eric -- Short of using custom software development, there is no way to force this issue with your PMs. If you want to try the custom software development route, then please repost your message in the microsoft.public.project.developer newsgroup. Otherwise, make this a training and performance issue with your PMs. Hope this helps. -- Dale A. Ho...

running header
How can I keep the numbers going in a order sequence and i donot see how to do a running header my teacher wants aour last name and the page number after it going in order number example Jones 1 next page jones 2 and she want it in a running header If this is Word 2003 or earlier, it is very simple. View | Header and Footer. This opens the header pane and displays the Header and Footer toolbar. Type your name and a space and then click the Insert Page Number button on the Header and Footer toolbar. Then click Close on the H&F toolbar. If it's Word 2007, double-click...

How to change item encoding with macro?
With russian outlook 2003 it has been possible to change item encoding individually, by opening each item and select it's appropriate menu. With russian outlook 2007 this is not working (as it seems). I want to automate it: convert several items in batch? Is it possible? TIA. ...

Running OS 9.2.2 with Office X Installed
I have an ibook that I prefer to run on OS 9.2.2. I have Office 98 and Office X installed. Whenever I double-click a word, excel or ppt file, I get a message telling me I need to be running OS X 10.1 or later. The MS website says that the Mac OS looks for the latest version of an app, and therefore finds the Office X version. The workaround is to always open files from within and application, BUT THIS IS A HUGE PAIN. Can anyone suggest another workaround? Will uninstalling Office X do the trick? Thanks in advance! On 9/17/04 4:13 PM, in article BD70CBCC.150A%rgregory@NOSPAMPLEASEfoxan...

Run report without running access?
Hi - Dumb question: To keep it simple, can I create a link or shortcut for a report so that with a click of the mouse the report will show? GWB wrote: > Hi - Dumb question: > To keep it simple, can I create a link or shortcut for a report so that > with a click of the mouse the report will show? You can have it open Access, then your file, then your report. But Access and your file have to be opened. ...

HELP! VC++/ADO connect & open a mdb problem!
Hi, I have a Mdb file on my WebPage http://www32.brinkster.com/atechcom/db/ClientDatabase.mdb 1) If I use strConnect = "URL=http://www32.brinkster.com/atechcom/db/ClientDataba se.mdb" or "provider=MSDAIPP.DSO;data source=http://www32.brinkster.com/atechcom/db/ClientDataba se.mdb" ... then I am able to connect to it ... but I could not open the table "Answer" in it (display error) 2) If I use the same database but in local computer strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\ClientDatabase.mdb" ... then I can open the table &q...

Run When Open Macro
I am looking for a Macro to tell another Macro to run automatically whenever I open an Excel workbook. Thanks for the help. T.R. Hi T.R Two ways Sub Auto_open() 'code or macro name End Sub Copy in a normal module If you use a Auto_open macro then this wil not run if you open the file with a macro Private Sub Workbook_Open() 'code or macro name End Sub Copy in the Thisworkbook module -- Regards Ron de Bruin http://www.rondebruin.nl "T.R." <anonymous@discussions.microsoft.com> wrote in message news:9d1601c49764$5fce35d0$a601280a@phx.gbl... >I am l...

running total (balance) reset on month change in pivot table
hi, have a simple question... how can i reset the running total in pivot table back to zero once the month changes ? mar 1 - 2000 - 2000 mar 2 - 3000 - 5000 mar 3 - 5000 - 10000 -------------------------------- apr 1 - 20000 - 20000 apr 2 - 50000 - 70000 that's all. shripal dalal. Hi Right click on your data field and choose Group and Show Detail>Group>select Months and Days>OK Then right click on PT>Wizard>Layout>reset your Sum of Value2 to be Running Total by Date. -- Regards Roger Govier "shripaldalal" <shripaldalal@gmail.com> wrote in mes...

Record a Macro in VB.NET 2008 Express?
Is there a way to record a Macro in VB.NET 2008 Express? I read about this in one of my books about Visual Studio. I didn't see any evidence of this kind of feature in VB.NET 2008 Express though. Thanks! Ryan-- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. On 12/17/2009 9:30 AM, ryguy7272 wrote: > Is there a way to record a Macro in VB.NET 2008 Express? I read about this > in one of my books about Visual Studio. I didn't see any evidence of this > kind of feature in VB.NET 2008 Express though. >...

Help with ShowFilter Macro
I'm trying to use this ShowFilter UDF written by Tom Ogilvy (see bottom of post). It says to use... =showfilter(B2)&CHAR(SUBTOTAL(9,B3)*0+32) ....in a cell to show the criteria for Column B. For one thing, I don't understand the cells B2 and B3 business. What is supposed to be in those cells? I would like this function to appear in the cell directly above or below the Autofilter menu cell. How do I change the function if the Autofilter criteria menu is in, cell A3, for example, and I want the criteria (this function) to appear just above, in cell A2? After trying all so...

Automatic Receipt of email when Outlook is opened
I am having to select Send/Receive to get email and I think there is a way for email to automatically come into Outlook from the server without that selection. This is a home computer running XP Pro on a Cable Modem. It is possible to set this up. Here is a link to an article that should walk you through the steps to make this happen, http://support.microsoft.com/default.aspx?scid=KB;EN-US;829168. I hope this helps resolve your issue. Robert Findlay Partner Technical Lead -- Outlook/Office Setup Microsoft Technical Support for Platforms and Business Applications ------------------...

can not run "Schedule Report", after install SRS connector
I just did a new installation for CRM 4.0. I can run reports from CRM. But I can not run "Schedule Report", I got the message "CRM 4.0 connector for SRS not installed". Then I installed it, the installation is all OK. But after I restart CRM, I still have the same error "CRM 4.0 connector for SRS not installed", when I run "Schedule Report". I try repair and reinstall. I still got the error. Any help is grateful, thanks ...

Macros in teplates
Hi Quick question - can Excel Templates contain macros? Thanks A Quick answer: Yes. -- Regards! Stefi „Alex Hammerstein” ezt írta: > Hi > > Quick question - can Excel Templates contain macros? > > Thanks > > A > > . > Yes. But I'm not sure if I would. When those macros need updating (and they always do!), it'll be difficult/impossible to find all the existing workbooks that have been created from that template (or copies of the workbooks based on that template). I'd consider creating an addin t...

How to Loop a macro in Excel
I've looked at some of the other reponses, but I'm an absolute beginner, because I haven't done macros for many years now. All I'm trying to do is copy a cell down a column until it hits the next value, then loop. There are irregular rows between each value. The data might look like this: 50000 (I want the macro to insert 50000 here) 600023.4 (I want the macro to insert 600023.4 here) (I want the macro to insert 600023.4 here) 945665 Just one question - what do...

running out of disk space
I seems to be getting a large number of temp_someFilename.zip in %temp% folder lately like 10 GB in two days. I deleted them a couple of days ago and got disk fill message today, seeing a large number of temp_....zip again in %temp% what is causing this? windows search? i've seen something like this before; could be spyware "GS" <gsmsnews.microsoft.comGS@msnews.Nomail.com> wrote in news:uig186UqKHA.4752@TK2MSFTNGP04.phx.gbl: > I seems to be getting a large number of temp_someFilename.zip in > %temp% folder lately > like 10 GB in two...

Won't Run #2
My MS Money 2002 version all of a sudden would not open no matter where we tried. I'm running windows XP and all other programs are fine.Any suggestions? Try reading some previous postings in this NG. It is all explained. -- Regards Bob Peel, Microsoft MVP - Money Hints/Tips http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny UK Wishes/Suggestions mnyukwsh@microsoft.com "Ed" <anonymous@discussions.microsoft.com> wrote in message news:10afb01c3f446$5aa5f6e0$a001280a@phx.gbl... > My MS Money 2002 version all of a sudden would not open > no m...

problem reading value from another Form
In frmMain I added a public property which returns a label contained in frmMain: public Label LblCD { get { return lblCurDir; } } I open the 2nd form, frm2, by clicking on a button on frmMain, and in frm2 I have this code: frmMain fMain; private string GetLblText() { return fMain.LblCD.Text; } the error I get when I try to invoke this proc on frm2 is: "Object reference not set to an instance of an object." I was thinking of trying frmMain fMain = new frmMain(); but I then I would not be able to read the current text contained in...

Great Plains 10 not running on a citrix server
We are updateing from GP8 to GP 10. We have serval sites in a fwe states. In our main office we are running local clients and they work great. But for our outer offices we use citrix 4.5 I can install Great Plain 10, put SP1 and run GP Utilites to snych with the database but once I Launch GP It starts to load, I see outlook 2003 flash 2 times then I get the error: "Microsoft Dynanics GP has encountered a problem and needs to close. We are sorry for the Inconveniece" Has anybody seen this or gotten around it? Thanks, Jon Jon, I assume you are just installing the clie...

Running sum running by date order
I have the following problem. I would like to create a running sum on a form or a query. It should sum PurchaseAmount but I have a problem with the where criteria of the Dsum. I use now (easier to check results): DCount("*","temp",("[Saved] <=" & "#" & [Saved] & "#" & "and [PurchaseID]<=" & [PurchaseID]) & "or" & (("[Saved] <=" & "#" & [Saved] & "#" & "and [PurchaseID]<=" & [PurchaseID]))) The problem is summery is c...

Macro triggers Virus Scanner
I use WinXP Home, Excel 2003, and Norton I/N Security. Several years ago, I created several macros, and associated toolbar buttons to perform some common tasks: formatting cells for dates, decimal, whole numbers, and inserting and adjusting column widths. They've functioned flawlessly until today. Today.when I click any of these buttons, I get this message, headed with an Excel banner: "The file cannot be opened because your virus scanner has detected a problem with the file" I have no idea what I did to cause this. I haven't made any changes either to the macros...

Tried to open audio made through Producer; Windows Media cannot op
I captured an audio of a class I needed to record for an hour [I was supposed to record and Instant Message the audio to othere in my group] I recorded by capturing audio only through producer. I saved the file at the end and it appears in a Producer project as if it were a Windows Media file... it has the .wma extension and the little icon of a Windows Media file. All looks good until I tried to open the file from Windows Media. Windows Media cannot open the file as it does not recognise the format [how is this possible when it appears to be a .wma file?] When I look for a .wma file ...

Sychronizing a combo box name to the form name
I swear as I get older, I get more forgetful. I've done this before, but its been about five years since I used the code. I have a lookup box on a form to choose a record. Howver when I use the navigation arrows I want the the name in the combo to change when the record changes. I checked Microsoft Knowledge Base and I looked briefly under the two Forms newsgroups. Can someone refresh my feeble mind on the code and where it goes. G., I suppose the code would go on the Current event of the form. And I suppose it would be something like this: Me.YourCombobox = <whatever it i...

Macro assist required
Hi, I have no idea how to create macro's so can one of up you help. When I save a sheet I wish to invoke the 'OnSave' command then input the date/time into a cell or sheet to record when the last update was. FIA Ram Hi this would require either an event procedure or a user defined function that shows the last save date. For the first one put the following code in your workbook module (see: http://www.cpearson.com/excel/events.htm) Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) me.worksheets("sheet1").value=Date End Sub -- Regards Fr...