Macro Action Fails on Duplicate Record

I have a form with a subform whose visibile property is set to no. I have a 
macro that runs when a choice is made in a combo box that sets the visible 
property of the subform to yes when the selection=2. The macro sets the 
visible property of the subform to no when the selection does not =2. This is 
how I have the macro:
Condition: [Appearance]=2
Action:Set Value 
Item: [Forms]![Appearance Request 
Basic]![OffSiteApp].[Form].[Detail].[Visible]
Expression: True

Condition:...
Action:StopMacro

Condition:(this I left blank)
Action: SetValue
Item:[Forms]![Appearance Request Basic]![OffSiteApp].[Form].[Detail].[Visible]
Expression:False

This macro runs in the AfterUpdate event of the combo box and on the 
OnCurrent event of the form.
This works great for what I want it to do, except when I try to make a 
duplicate record it says that the action failed. If I hit halt until it goes 
away, it makes the duplicate record and shows the subform correctly.
My question is, how do I get it to not show the action failed error? (And it 
seems odd to me that it claims the action has failed when it clearly hasn't).
Thanks in advance for your help!
0
Utf
12/23/2007 3:49:00 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
942 Views

Similar Articles

[PageSpeed] 53

Clddleopard,

First comment to make here, not directly related to your question, is 
that the Item expression is more complicated than it needs to be.  Is 
'OffSiteApp' the name of the subform?  If so, I think you only need like 
this:
Item: [OffSiteApp].[Visible]

When you say a "duplicate record", do you mean a new record?  On the 
main form?  How are you doing this?... Just going to a new record via 
the navigation buttons. or some other type of macro or code?  And can 
you also please say which action the Action Failed dialog is referring to?

-- 
Steve Schapel, Microsoft Access MVP

Clddleopard wrote:
> I have a form with a subform whose visibile property is set to no. I have a 
> macro that runs when a choice is made in a combo box that sets the visible 
> property of the subform to yes when the selection=2. The macro sets the 
> visible property of the subform to no when the selection does not =2. This is 
> how I have the macro:
> Condition: [Appearance]=2
> Action:Set Value 
> Item: [Forms]![Appearance Request 
> Basic]![OffSiteApp].[Form].[Detail].[Visible]
> Expression: True
> 
> Condition:...
> Action:StopMacro
> 
> Condition:(this I left blank)
> Action: SetValue
> Item:[Forms]![Appearance Request Basic]![OffSiteApp].[Form].[Detail].[Visible]
> Expression:False
> 
> This macro runs in the AfterUpdate event of the combo box and on the 
> OnCurrent event of the form.
> This works great for what I want it to do, except when I try to make a 
> duplicate record it says that the action failed. If I hit halt until it goes 
> away, it makes the duplicate record and shows the subform correctly.
> My question is, how do I get it to not show the action failed error? (And it 
> seems odd to me that it claims the action has failed when it clearly hasn't).
> Thanks in advance for your help!
0
Steve
12/23/2007 5:46:33 PM
Steve,
Thank you!
The simplified Item fixed the whole problem. I don't know why, but it worked.
Thanks for pointing that out!
"Steve Schapel" wrote:

> Clddleopard,
> 
> First comment to make here, not directly related to your question, is 
> that the Item expression is more complicated than it needs to be.  Is 
> 'OffSiteApp' the name of the subform?  If so, I think you only need like 
> this:
> Item: [OffSiteApp].[Visible]
> 
> When you say a "duplicate record", do you mean a new record?  On the 
> main form?  How are you doing this?... Just going to a new record via 
> the navigation buttons. or some other type of macro or code?  And can 
> you also please say which action the Action Failed dialog is referring to?
> 
> -- 
> Steve Schapel, Microsoft Access MVP
> 
> Clddleopard wrote:
> > I have a form with a subform whose visibile property is set to no. I have a 
> > macro that runs when a choice is made in a combo box that sets the visible 
> > property of the subform to yes when the selection=2. The macro sets the 
> > visible property of the subform to no when the selection does not =2. This is 
> > how I have the macro:
> > Condition: [Appearance]=2
> > Action:Set Value 
> > Item: [Forms]![Appearance Request 
> > Basic]![OffSiteApp].[Form].[Detail].[Visible]
> > Expression: True
> > 
> > Condition:...
> > Action:StopMacro
> > 
> > Condition:(this I left blank)
> > Action: SetValue
> > Item:[Forms]![Appearance Request Basic]![OffSiteApp].[Form].[Detail].[Visible]
> > Expression:False
> > 
> > This macro runs in the AfterUpdate event of the combo box and on the 
> > OnCurrent event of the form.
> > This works great for what I want it to do, except when I try to make a 
> > duplicate record it says that the action failed. If I hit halt until it goes 
> > away, it makes the duplicate record and shows the subform correctly.
> > My question is, how do I get it to not show the action failed error? (And it 
> > seems odd to me that it claims the action has failed when it clearly hasn't).
> > Thanks in advance for your help!
> 
0
Utf
12/23/2007 6:20:01 PM
Reply:

Similar Artilces:

recording changes
I have a field called "TimeStamp" What I would like is that if someone modifiys or make any change in the form that the "TimeStamp" will record the time and date of change. How can this be achieved? sandrao In an event procedure in the form's AfterUpdate event, you could do something like: Me!txtYourTimeStampField = Now() Note that if you use the BeforeUpdate event, every time your code changes the value of this field, the form tries to update, the BeforeUpdate (re-)triggers, and you "loop up" (at least, it seems to me I've seen this...)...

spell check does not visually cycle through cells when run from macro?
I'm trying to recreate the same behavior in a macro that spellcheck has when the spellcheck button is pressed. The spellcheck does not cycle through the cells visually when run from a macro, so when there is a misspelled word, you cannot see the cell it is a part of. If anyone knows how I can get this behavior to work, it would be GREATLY appreciated. I did a record new macro, and got code similar to the following: Sub testSpelling() Range("F2:F500").Select Selection.CheckSpelling SpellLang:=1033 End Sub thanks, dan Dan, Add the fiollowing to your code as shown: ...

Failed CRM for Outlook Install
I am trying to install CRM for Outlook on a computer but it kleeps failing with the following error: "Setup has failed because of an error. Setup was unable to install the .msi file for Microsoft CRM Sales for Outlook" The user has Administative rights to the system, she has an account in CRM and a license. This is very frustrating since I have to clean up the registry every time I reinstall since it crashes before putting anything in the add remove control panel. Any ideas? -- Francois Try to uninstall MSDE and make sure you have all the databases removed. The default in...

Setting directory for file save in macro
Hi Thanks to a generous poster I now have a great bit of code to use in a macro for Excel which saves a text file (I'm no VBA programmer so this was really helpful), i.e.: Open "Test.txt" For Output As #1 (rest of code) My problem now is this: The macro saves test.txt to Excel's current active folder, rather than the folder that the current workbook is contained in. For example, if I last saved an Excel workbook to c:\workbooks\, and the workbook that I have open exists in c:\workbooks\workbook1\, when I run the macro it saves the text file in c:\workbooks\. If I ...

Possible to Look Up Records by Initials?
I have a user who's telling me that prior to this weekend in CRM, she could lookup user records by initials rather than typing in part of the name. I don't see where that setting would have been marked in CRM. Has anyone else heard of this? If so, how did you implement this type of search customization/configuration? Steps to recreate problem: Account screen Account Owner field's magnifying glass Assign Account Assign to another user fields magnifiying glass Look Up Records' Look For field = initials of user you're attempting to Find. I doubt you can use the init...

How to record percentage increases in materials costing sheet.
I am trying to do a materials costing sheet where I would like to be able to periodically increast the base cost of the product by different percentages. E.g. Cost of Apples $10.00 but might be increased by 5% then 2.5% and therefore the base cost would keep changing. I know how do first % increase but not how to then use that figure as the base figure for future adjustments. Thanks for amy help. I am very new to this. You could put a % in one cell. Select the cell and give it a name by Insert-->Name-->Define. Call it "increase". Then, in the cell where you put the f...

HOWTO create a Mail Merge Template in MSCRM with multiple child records
Hi, I have created successfully a basic Mail Merge template in MS Word in Dynamics CRM 4.0 for Order Entity. My challenge now is how to design a template that retrieves the order details (product and prices) related to the order record? This sounds like a parent-child template. Any idea? On Jun 2, 1:26=A0pm, "Benjie Fallar III" <bfall...@hotmail.com> wrote: > Hi, > I have created successfully a basic Mail Merge template in MS Word in > Dynamics CRM 4.0 for Order Entity. > My challenge now is how to design a template that retrieves the order > details (prod...

Exchange fails to send CRM emails
When I try to send emails using the CRM 3.0 web interface "most" of them fail to be sent. If I copy that exact same and email and send it to the same address using outlook 2003 it sends with no problem. Exchange 2003 will send me an email, a day later that is is delayed and then finally another day later that it failed. I have turned off the email tracking in CRM and this did not help. I thought the numbers CRM puts in the subject may have been causing it to be blocked. What could be causing the emails to fail when sent using CRM and the exact same email to work with Outlook...

dmLog: IsCRMSysAdmin: WhoAmI failed
We are having severe problems with CRM. We did some unrelated maintenance work this past weekend, and when we brought the CRM server up, it was not working. As near as I can tell, CRM is completely unable to launch when the server reboots. In the error log, I keep seeing the following error every time we reboot the machine: dmLog: IsCRMSysAdmin: WhoAmI failed When someone tries to access CRM, the following error appears in the log: MSCRM Platform Error Report: There is no such object on this server. Any help would be greatly appreciated! Paul McBride Hi, There could be many reaso...

Recording ownership in an LLC partnership
I'm a partner in an LLC company and would like to track my ownership interest in Money 2004. It's not "real" obvious how I might go about this, particularly ... What account type should be used? How do I record my portion of the profits earned, for which I'm am personally taxed? How do I record the gain in ownership value these profits provided when I haven't necessarily received them in cash? How do I record a portion of these profits as received in cash when they aren't dividends but distributions? I'd prefer to use an investment oriented approach rather ...

Can you record a macro in Publisher like you can in Excel?
In Excel I use the feature to Record a Macro. Excel records the keystrokes and converts to VB. Does Publisher have that option? In my version, Publisher 2003, I can Create a Macro, and it takes me into VB. However, I don't know how to code VB. Darlene wrote: > In Excel I use the feature to Record a Macro. Excel records the keystrokes > and converts to VB. Does Publisher have that option? In my version, > Publisher 2003, I can Create a Macro, and it takes me into VB. However, I > don't know how to code VB. Publisher does not have a Macro Recorder, sorry. --...

Macros/Signatures Question
I have an Excel Workbook that I created for a PC Order Form. I set it up to only make certain rows visible based on the Machine Model that they choose. I digital signed the Worksheets and exported the Digital Signature Certificate and installed it on the User’s PCs. The code works great. The user opens the Workbook and it runs the Macros with no problem. The problem I have is when the user goes to save the Workbook. They get an error that “Excel can not sign VBA macros when saving to this file format. Do you want to remove the digital signature and continue saving this workbook?”...

Macro Copy and Paste
I am currently trying to copy from one workbook that has 7 differen tabs and paste into one worksheet on a separate master workbook. M problem is that when I set up the macro to copy from one of the tabs i the workbook and paste to the other work book, I only want the the row to come in where there is data. Currently I am having to run a macr that takes every 100 lines, but ideally I only want the informatio copy and pasted where there is only data. In addition, once I have copy and pasted everything from the first tab my next step is to copy and paste information from the second tab t th...

How to assign unique number to column duplicates?
Hi All, I need to assign a unique number to a set of duplicates all in one column in Excel 2007. so columnA will has about 9000 numbers, some of them unique, and others are duplicates of 2-4 approx. I used to conditional formatting to show which are duplicates, but need to be able to assign a unique number to each set duplicates, that will be in sequential order... e.g. ColumnA ColumnB(unique ID) 01233 0001 01233 0001 01234 - 01255 0002 01255 0002 etc.... Any ideas please? I don't know how to do programming, just form...

Referring to a FileName in Macro
I have a Macro with the following code Application.Run "TestQry!Macro2" Application.Run "TestQry!Macro1" TestQry is the name of the file. Is there anyway that this macro cod can refer to the activeWorkbook or filename so that if the file i saved to a new name this macro will still ru -- Message posted from http://www.ExcelForum.com How about just: macro2 or even call macro2 "DoctorV <" wrote: > > I have a Macro with the following code > > Application.Run "TestQry!Macro2" > Application.Run "TestQry!Macro1" > &g...

Macro Question #10
Hi, I am working with a text file that I imported into Excel. It is a transactional report of sales by customer. The data will have the customer number and name spread out over three cells. What I want to do is to create a macro that will contatenate all three cell and then perform a paste special and paste them into another cell in another column. Since the number of transactions by customer can vary the customer name and number can appear anywhere on the page. I created a macro to do this using the first customer which appears in cell B5 through D5. The next customer appears...

Spreadsheet macro stopped working!
Hi, I recently made an Excel spreadsheet for keeping track of my golf score. The spreadsheet is quite simple. It consists of 4 sheets: Scorecard, statistics, database and equations (for calculating some specific). I insert informations about the golf course I'm playing and how my score was etc. I then hit a button "Save scorecard" that runs a macro. The macro inserts specifik values from the scorecard into the database sheet (which works like a charm). The macro also updates the "Statistics" sheet with information about stroke number and points for ...

Sorting records in the Report Design View
Currently, I use "Sorting and Grouping" tool in the Report Design View to create group headers so that I can group my data accordingly. However, I would like to know if I can apply a custom sort order. For example, the field name that I want to group is "Region". I have records of "East", "North", "South", and "West". Is there a way that I can order by "North", "South", "East", and "West" instead? If I use the "Sorting and Grouping" tool, it won't work because it only accepts a...

records in current month
Hi I want to use a query that returns records in the current month from a date field, but cant work the query out - anyone help please Thanks Alec Set the criteria under the date field to: Between Date()-Day(Date())+1 AND DateSerial(Year(Date()),Month(Date())+1,0) -- Duane Hookom Microsoft Access MVP "alecgreen" wrote: > Hi > > I want to use a query that returns records in the current month from a > date field, but cant work the query out - anyone help please > > Thanks > > Alec > > ...

Excel 2007 macro compatability
I have created a macro in Excel 2007 that includes importing a text file. It works fine on my PC, but fails on a co-workers PC running Excel 2000. The failure points to the "TextFile Platform" command in the macro. I have tried several (437, 1252, 20127), but get the same results. Any solution? Thanks you. Have you try xlWindows -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Al @ Frontier" <Al @ Frontier@discussions.microsoft.com> wrote in message news:3F601F80-F099-42C8-AA18-6D31A85946F9@microsoft.com... >I have cr...

Excel E-mail Macros
I need to know how to create a macro that will send an excel file as an attachment to one individual, and then send one of the file's worksheets to 3 e-mail addresses using the mail recipient method so that the worksheet appears in the body of the e-mail. The e-mail program I am using is Outlook. Any help with this will be GREATLY appreciatd. Hi John, I'd tell you, but Ron de Bruin already did all the work. It'd be silly for me to do it again...Try Ron's site: http://www.rondebruin.nl/sendmail.htm tim "John" <jbegley@dcas.nyc.gov> wrote in message ne...

Objects duplicated
If a workbook consists of Objects: Sheet1, Sheet2, This Workbook.... What would cause Excel to duplicate these objects in the same workbook. Somehow, I now have to sets of objects in the same workbook that are exactly the same. ...

format macro
Last week, Art was trying to help me with this, but the solution doesn't work for me. I'm looking for a macro that would be contained within my personal.xls, that I could use as needed. Lets say I have A1:C5 selected, which represent headdings and data for jan, feb and march. [On a different spreadsheet, it may be different columns, or a different number of columns. The point is that I will select the range before I run the macro.] I want to do an auto fit for each column, so that the column widths are big enough to fit the numbers. No problem, format-->column-->autof...

Show me these records
Ok, I guess I didn't really post what I needed earlier. I need to see the info in column a,b,c,d,e,f where column "c" contains street name of "ivycrest" and I have multiple streets. How do I do this? Please help? MS Access has records and MS Excel has columns. You would use a Query in MS Access and Find in MS Excel. Tammy wrote: > Ok, I guess I didn't really post what I needed earlier. > > I need to see the info in column a,b,c,d,e,f where column "c" contains > street name of "ivycrest" > > and I have multiple st...

Record of attached file
Does anybody know how to make Outlook 2002 automatically insert the file name (of the file that is attached to the e-mail) at the bottom of the body of the message? example: <<test.xls>> Outlook Rich Text - files inserted in the body where the insertion point it. Plain Text - files inserted in window below the message body. HTML - files inserted in header just below the subject. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted ...