Advertisement

09.06.2008 at 12:39AM PDT, ID: 23708429
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.5

Write conflict error for dirty object in MS access !

Asked by jaisonshereen in Visual Basic Programming, Microsoft Access Database, Microsoft Development

I am getting error as shown in the thread ... !!

I have a software which is developed in VB and MS access. This software is giving an error when click on the button "view"

Then click code of the view button is shown below the error which i am experiencing is also shown below:

Please check and let me know how i can rectify this error . Also please let me know any code samples of this software is needed for you. Other than that i provided below to rectify this error.


Please see this thread :

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_23699433.html#a22390110


Please find the threads for your assistance and tell me how can i trouble shoot in my code:

http://bytes.com/forum/thread201797.html
http://www.dbforums.com/archive/index.php/t-369845.html
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23418538.htmlStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
Private Sub Cmd_View_Click()
On Error GoTo Err_Cmd_View_Click
 
    Dim ArticleInfo As ArticleInfo
    Dim i As Integer
    Dim Parameters As BM_Parameters
    Dim Edited_ImpactVol_val As Impact
    Dim Edited_ImpactRev_val As Impact
    Dim Edited_ImpactMg_val As Impact
 
    Dim ImpactVol_val As Impact
    Dim ImpactRev_val As Impact
    Dim ImpactMg_val As Impact
 
    Dim Uplift_Avg As Double
    
    'Loop through all articles on in sheet and calculate the financials
    
    Set db = CurrentDb
    Set recordset = db.OpenRecordset("select * from T_TableName1")
    
    'required so that the recordcount is accurate
    recordset.MoveLast
    recordset.MoveFirecordset
    
    For i = 1 To recordset.RecordCount
   
        recordset.Edit
        'Update the TempOrdID
        Let recordset.Temp_OrdID = Project1.Form_T_FormCreateNewOrdtion_EntryForm.Txt_TempOrdID
    
        'Update article Info
        ArticleInfo = Get_ArticleInfo(recordset.Article)
        
        recordset.Article_desc = ArticleInfo.Article_desc
        recordset.BM_ID = ArticleInfo.BM_ID
        recordset.Cat_ID = ArticleInfo.Cat_ID
        recordset.Subcat_ID = ArticleInfo.Subcat_ID
        recordset.Cost_current = ArticleInfo.Cost_current
        recordset.Price_current = ArticleInfo.Price_current
        
        Dirty = False
    
        'Update temp table with static parameters
        Parameters = Get_BMparameters(recordset.BM_ID)
        
        recordset.Cann = Parameters.Cann
        recordset.Edited_cann = Parameters.Cann
        recordset.PF = Parameters.PF
        recordset.Edited_PF = Parameters.PF
        recordset.AverageBMPrice = Parameters.BM_PriceAvg
        recordset.AverageBMMargin = Parameters.BM_MarginAvg
        recordset.VariableCostperUnit = Parameters.VarCost
        recordset.Edited_VariableCostPerUnit = Parameters.VarCost
        
        Dirty = False
        
        recordset.Update
    
        DoCmd.SetWarnings False
    
        'update the temp table with promo id, promo period, period length and start/end dates
        'XXXXX this can be entered manually by refering title form RST.EnteredBy = Project1.form...
        DoCmd.OpenQuery "T_120_q013_UpdateSaveWithTempOrdID_UPDATE"
           
        'update 10% day proportions
        DoCmd.RunSQL "UPDATE T_Static_024_10Day_Proportion INNER JOIN T_FPtr_InputTable_Save_NEW ON T_Static_024_10Day_Proportion.BM_ID = T_FPtr_InputTable_Save_NEW.BM_ID SET T_FPtr_InputTable_Save_NEW.TenPctWeek_PropDiscount = T_Static_024_10Day_Proportion.[10dayproportion]"
            
        'update edited 10% day base volume
        DoCmd.RunSQL "UPDATE T_Static_023_10Day_Uplift INNER JOIN T_FPtr_InputTable_Save_NEW ON (T_Static_023_10Day_Uplift.BM_ID = T_FPtr_InputTable_Save_NEW.BM_ID) AND (T_Static_023_10Day_Uplift.Ord_Period = T_FPtr_InputTable_Save_NEW.Ord_Period) SET T_FPtr_InputTable_Save_NEW.[10Day_Base_vol] = [base_vol]*(T_Static_023_10Day_Uplift.[10% Day uplift]+1)"
        
        'update cost as pct of buy for storage
        DoCmd.OpenQuery "T_220_q032_CostOfOrdStorage_LS_UPDATE"
        
        'updates subcat average price in temp table
        DoCmd.OpenQuery "T_250_q012_UpdateSubcatPrice_LS_UPDATE"
        
        'updates estimated base volume to zero initially
        Let SQLString_UpdateModelBase_Zero = " UPDATE T_FPtr_InputTable_save_NEW SET T_FPtr_InputTable_save_NEW.ModelBaseVol = 0; "
        DoCmd.RunSQL SQLString_UpdateModelBase_Zero
        
        'updates estimated base volume to correct values if the articles are present in table t_ArticleBaseVol_BaseVolOutput
        Let SQLString_UpdateModelBase = " UPDATE t_ArticleBaseVol_BaseVolOutput INNER JOIN T_FPtr_InputTable_save_NEW ON (t_ArticleBaseVol_BaseVolOutput.article = T_FPtr_InputTable_save_NEW.Article) AND (t_ArticleBaseVol_BaseVolOutput.promoperiod = T_FPtr_InputTable_save_NEW.Ord_Period) SET T_FPtr_InputTable_save_NEW.ModelBaseVol = [t_ArticleBaseVol_BaseVolOutput].[period_baseline];"
        DoCmd.RunSQL SQLString_UpdateModelBase
        
        recordset.Edit
    
        'Update A and B price
 
 
 
        If recordset.AverageBMPrice = Empty Then
            
            If (recordset.Edited_cann_price_was) = recordset.Cann_price_was Then recordset.Edited_cann_price_was = recordset.Price_was
            If (recordset.Edited_B_price_was) = recordset.Pullforward_price_was Then recordset.Edited_B_price_was = recordset.Price_was
            recordset.Cann_price_was = recordset.Price_was
            recordset.Pullforward_price_was = recordset.Price_was
        
        Else
            
            If (recordset.Edited_cann_price_was) = recordset.Cann_price_was Then recordset.Edited_cann_price_was = (recordset.AverageBMPrice + recordset.Price_was) / 2
            If (recordset.Edited_B_price_was) = recordset.Pullforward_price_was Then recordset.Edited_B_price_was = (recordset.AverageBMPrice + recordset.Price_was) / 2
            Let recordset.Cann_price_was = (recordset.AverageBMPrice + recordset.Price_was) / 2
            Let recordset.Pullforward_price_was = (recordset.AverageBMPrice + recordset.Price_was) / 2
        
        End If
 
        'Update A and B margins
        If recordset.AverageBMMargin = Empty Then
            
            If (recordset.Edited_cann_margin) = recordset.Cann_margin Then recordset.Edited_cann_margin = recordset.Price_was - recordset.cost_price_regular
            If (recordset.Edited_B_margin) = recordset.Pullforward_margin Then recordset.Edited_B_margin = recordset.Price_was - recordset.cost_price_regular
            recordset.Cann_margin = recordset.Price_was - recordset.cost_price_regular
            recordset.Pullforward_margin = recordset.Price_was - recordset.cost_price_regular
        
        Else
            
            If (recordset.Edited_cann_margin) = recordset.Cann_margin Then recordset.Edited_cann_margin = (recordset.AverageBMMargin + recordset.Price_was - recordset.cost_price_regular) / 2
            If (recordset.Edited_B_margin) = recordset.Pullforward_margin Then recordset.Edited_B_margin = (recordset.AverageBMMargin + recordset.Price_was - recordset.cost_price_regular) / 2
            recordset.Cann_margin = (recordset.AverageBMMargin + recordset.Price_was - recordset.cost_price_regular) / 2
            recordset.Pullforward_margin = (recordset.AverageBMMargin + recordset.Price_was - recordset.cost_price_regular) / 2
        
        End If
 
        recordset.Update
        
        If recordset.RecordCount > 0 Then
                        
           recordset.Edit
        
            'Calculate and update the average uplift
            Uplift_Avg = Impact_WeeklyAvg(recordset.Edited_Uplift, recordset.[10Day_Uplift], recordset.period_length, recordset.pct_weeks)
        
            'Calculate and update the financial impact using ALL EDITED INPUTS
            Edited_ImpactVol_val = ImpactVol(recordset.Base_vol, recordset.[10Day_Base_vol], recordset.Edited_Uplift, recordset.[10Day_Uplift], recordset.Edited_cann, recordset.Edited_PF, recordset.period_length, recordset.pct_weeks)
            Edited_ImpactRev_val = ImpactRev(recordset.Base_vol, recordset.[10Day_Base_vol], recordset.TenPctWeek_PropDiscount, recordset.Edited_Uplift, recordset.[10Day_Uplift], recordset.Price_was, recordset.VAT_Rate, recordset.Discount, recordset.Edited_cann, recordset.Edited_PF, recordset.Edited_cann_price_was, recordset.Edited_B_price_was, recordset.period_length, recordset.pct_weeks, recordset.DirectHalo, recordset.Avg_price_subcat)
            Edited_ImpactMg_val = ImpactMg(recordset.Base_vol, recordset.[10Day_Base_vol], recordset.TenPctWeek_PropDiscount, recordset.Edited_Uplift, recordset.[10Day_Uplift], recordset.Price_was, recordset.Discount, recordset.VAT_Rate, recordset.Edited_cann, recordset.Edited_PF, recordset.Edited_cann_price_was, recordset.Edited_B_price_was, recordset.Edited_cann_margin, recordset.Edited_B_margin, recordset.Edited_VariableCostPerUnit, recordset.SF_Retrospective_per_item, recordset.SF_Total_Per_period, recordset.cost_price_regular, recordset.Cost_price_promo, recordset.period_length, recordset.pct_weeks, recordset.DirectHalo, recordset.Avg_price_subcat)
 
        
            'Calculate and update the financial impact using NON EDITED INPUTS
            'Please note that a the uplift used in all calculations is the manually entered one (not predicted)
            ImpactVol_val = ImpactVol(recordset.Base_vol, recordset.[10Day_Base_vol], recordset.Edited_Uplift, recordset.[10Day_Uplift], recordset.Cann, recordset.PF, recordset.period_length, recordset.pct_weeks)
            ImpactRev_val = ImpactRev(recordset.Base_vol, recordset.[10Day_Base_vol], recordset.TenPctWeek_PropDiscount, recordset.Edited_Uplift, recordset.[10Day_Uplift], recordset.Price_was, recordset.VAT_Rate, recordset.Discount, recordset.Cann, recordset.PF, recordset.Cann_price_was, recordset.Pullforward_price_was, recordset.period_length, recordset.pct_weeks, recordset.DirectHalo, recordset.Avg_price_subcat)
            ImpactMg_val = ImpactMg(recordset.Base_vol, recordset.[10Day_Base_vol], recordset.TenPctWeek_PropDiscount, recordset.Edited_Uplift, recordset.[10Day_Uplift], recordset.Price_was, recordset.Discount, recordset.VAT_Rate, recordset.Cann, recordset.PF, recordset.Cann_price_was, recordset.Pullforward_price_was, recordset.Cann_margin, recordset.Pullforward_margin, recordset.VariableCostperUnit, recordset.SF_Retrospective_per_item, recordset.SF_Total_Per_period, recordset.cost_price_regular, recordset.Cost_price_promo, recordset.period_length, recordset.pct_weeks, recordset.DirectHalo, recordset.Avg_price_subcat)
        
            'UPLIFT VALUE
            recordset.Avg_uplift = Uplift_Avg
            recordset.Cost_Storage = (Edited_ImpactVol_val.Total_Avg) * recordset.Cost_price_promo * recordset.Cost_Storage_Pct
            
            recordset.Update
            recordset.Edit
            
            'EDITED VALUE
            recordset.Avg_base_volume = Edited_ImpactVol_val.Base_Avg
            recordset.Avg_weekly_base_revenue = Edited_ImpactRev_val.Base_Avg
            recordset.Avg_weekly_base_margin = Edited_ImpactMg_val.Base_Avg
                    
            recordset.Edited_volume_direct_avg = Edited_ImpactVol_val.Direct_Avg
            recordset.Edited_Revenue_avg_direct = Edited_ImpactRev_val.Direct_Avg
            recordset.Edited_Margin_avg_direct = Edited_ImpactMg_val.Direct_Avg
            
            recordset.Edited_volume_cann = Edited_ImpactVol_val.Cann_Avg
            recordset.Edited_Revenue_avg_cann = Edited_ImpactRev_val.Cann_Avg
            recordset.Edited_Margin_avg_cann = Edited_ImpactMg_val.Cann_Avg
            
            recordset.Edited_volume_B = Edited_ImpactVol_val.PF_Avg
            recordset.Edited_Revenue_avg_B = Edited_ImpactRev_val.PF_Avg
            recordset.Edited_Margin_avg_B = Edited_ImpactMg_val.PF_Avg
            
            recordset.Edited_margin_avg_variablecosts = Edited_ImpactMg_val.VarCost_Avg
            recordset.SF_per_week = Edited_ImpactMg_val.SupplierFunding_Avg
            
            recordset.DirectHalo_avg_rev = Edited_ImpactRev_val.DirectHalo_Avg
            recordset.DirectHalo_avg_mg = Edited_ImpactMg_val.DirectHalo_Avg
            recordset.DirectHalo_reg_rev = Edited_ImpactRev_val.DirectHalo_Reg
            recordset.DirectHalo_reg_mg = Edited_ImpactMg_val.DirectHalo_Reg
            
            recordset.Edited_Volume_Total = Edited_ImpactVol_val.Total_Avg
            recordset.Edited_Revenue_avg_total = Edited_ImpactRev_val.Total_Avg
            recordset.Edited_Margin_avg_total = Edited_ImpactMg_val.Total_Avg
            
            recordset.Edited_Revenue_reg_total = Edited_ImpactRev_val.Total_Reg
            recordset.Edited_Margin_reg_total = Edited_ImpactMg_val.Total_Reg
            recordset.Edited_Volume_reg_total = Edited_ImpactVol_val.Total_Reg
    
            'MODEL VALUES
            recordset.Volume_direct_avg = ImpactVol_val.Direct_Avg
            recordset.Revenue_avg_direct = ImpactRev_val.Direct_Avg
            recordset.Margin_avg_direct = ImpactMg_val.Direct_Avg
            
            recordset.Volume_cann = ImpactVol_val.Cann_Avg
            recordset.Revenue_avg_cann = ImpactRev_val.Cann_Avg
            recordset.Margin_avg_cann = ImpactMg_val.Cann_Avg
            
            recordset.Volume_B = ImpactVol_val.PF_Avg
            recordset.Revenue_avg_B = ImpactRev_val.PF_Avg
            recordset.Margin_avg_B = ImpactMg_val.PF_Avg
            
            recordset.margin_avg_variablecosts = ImpactMg_val.VarCost_Avg
            recordset.SF_per_week = ImpactMg_val.SupplierFunding_Avg
            
            recordset.Volume_total = ImpactVol_val.Total_Avg
            recordset.Revenue_avg_total = ImpactRev_val.Total_Avg
            recordset.Margin_avg_total = ImpactMg_val.Total_Avg
    
            recordset.Update
 
        End If
 
        recordset.MoveNext
      
    Next i
 
    recordset.Close
    
    Call CalculateTotal
        
    DoCmd.Close acForm, "T_in_save_setting"
    
    DoCmd.OpenForm "T__POS&Input_MAIN"
    
Exit_Cmd_View_Click:
    Exit Sub
 
Err_Cmd_View_Click:
    
    'Operation must use updatable query - just in case primary key lost!
    If Err.Number = 3073 Then Resume Next
    
    ApplicationError Err.Number, Err.Description, "Form_T_In_save_Setting\Cmd_View_Click"
    Resume Exit_Cmd_View_Click
 
End Sub
Attachments:
 
Error
Error
 
 
Loading Advertisement...
 
[+][-]09.06.2008 at 03:59AM PDT, ID: 22406852

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 05:37AM PDT, ID: 22407193

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 08:57AM PDT, ID: 22407935

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 03:52PM PDT, ID: 22409344

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 10:12PM PDT, ID: 22410237

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 04:04AM PDT, ID: 22410878

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 06:54AM PDT, ID: 22411426

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 07:16AM PDT, ID: 22411508

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 04:41AM PDT, ID: 22416273

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 05:04AM PDT, ID: 22416424

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 05:39AM PDT, ID: 22416643

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 07:26AM PDT, ID: 22417670

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 07:30AM PDT, ID: 22417712

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 08:24AM PDT, ID: 22418303

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.17.2008 at 05:24AM PDT, ID: 22497616

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.17.2008 at 06:28AM PDT, ID: 22498249

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, Microsoft Access Database, Microsoft Development
Sign Up Now!
Solution Provided By: LSMConsulting
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628