?
Solved

2113 value you entered isnt valid

Posted on 2008-11-20
18
Medium Priority
?
359 Views
Last Modified: 2013-11-28
 I am getting the following message when i enter data and press tab in a vba text box

"2113 value you entered isnt valid for the field( Form_T_F020_InputTable_PriceAction\Txt_ArticleLostfocus)

Please help me
0
Comment
Question by:jaisonshereen
  • 10
  • 5
  • 3
18 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 23003928
it is very clear from the error message, that you entered a value that is not valid.

open the form in design view,
select  Txt_Article and hit F4 to open the property sheet
select the Data tab and look for properties
   validation text
   validation rule

also, check the field validation text and validation rule where the Txt_Article is bound to
0
 

Author Comment

by:jaisonshereen
ID: 23004008
i entered 75644

please see the properties
Properties.jpg
0
 

Author Comment

by:jaisonshereen
ID: 23004034
This is code for the lost focus which is fired when i press tab button which internally gives this error message box
Private Sub Txt_Article_LostFocus()
On Error GoTo Err_Txt_Article_LostFocus
 
    Select Case Me.Txt_Article
 
        Case 0
        
            'Do nothing if article 0
            
        Case Null
        
            'Do nothing if null
            
        Case 0 To 100
        
            If ArticleDuplicate(Me.Txt_Article) Then Exit Sub
            
            'Update article number in table
            Dirty = False
            
            Me.Temp_PromoID = Project1.Form_T_F073_PromotionHeader.Txt_Temp_PromoID
            Me.Promo_period = Project1.Form_T_F073_PromotionHeader.Txt_PromoPeriod
            Me.period_length = Project1.Form_T_F073_PromotionHeader.Txt_PeriodLength
            If IsNull(Me.EnteredBy) Then Me.EnteredBy = Project1.Form_T_F073_PromotionHeader.Txt_EnteredBy
            Me.pct_weeks = Project1.Form_T_F073_PromotionHeader.Txt_PCTweeks
            
            Call DummyArticleCheck
            
            If Me.BMC_ID = 0 Then GiveError (3301)
                        
            'Update uplift with structural modelling uplift predictions
            DoCmd.SetWarnings False
            DoCmd.OpenQuery "T_160_q020_StructuralModeling_UPDATE"
            DoCmd.SetWarnings True
                        
            Me.Refresh
            
            'update the cannibalisation and pullforward prices & margins to halfway between BMC_avg and article_price
            Call Update_Prices_CannPF
            
        Case Else
        
            If ArticleDuplicate(Me.Txt_Article) Then Exit Sub
                    
            'Update article number in table
            Dirty = False
                    
            'Dummy article flag set but article >100 entered
            If Me.Check_Dummy Then
            
                Me.Check_Dummy = False
                Call DummyArticleCheck
                
            End If
            
            Me.Temp_PromoID = Project1.Form_T_F073_PromotionHeader.Txt_Temp_PromoID
            Me.Promo_period = Project1.Form_T_F073_PromotionHeader.Txt_PromoPeriod
            Me.period_length = Project1.Form_T_F073_PromotionHeader.Txt_PeriodLength
            If IsNull(Me.EnteredBy) Then Me.EnteredBy = Project1.Form_T_F073_PromotionHeader.Txt_EnteredBy
            Me.pct_weeks = Project1.Form_T_F073_PromotionHeader.Txt_PCTweeks
                
            Dim ArticleInfo As ArticleInfo
            ArticleInfo = Get_ArticleInfo(Me.Article)
            
            If ArticleInfo.Blacklisted Then
                GiveError (3310)
                Exit Sub
            End If
            
            Me.Article_desc = ArticleInfo.Article_desc
            Me.BMC_ID = ArticleInfo.BMC_ID
            Me.Cat_ID = ArticleInfo.Cat_ID
            Me.Subcat_ID = ArticleInfo.Subcat_ID
            Me.Cost_current = ArticleInfo.Cost_current
            Me.Price_current = ArticleInfo.Price_current
            Me.Price_was_euro = ArticleInfo.Eire_current
            Me.Txt_Vendor = ArticleInfo.VendorNo & " " & ArticleInfo.VendorName
            Me.WEEE = ArticleInfo.WEEE_category
                
            If ArticleInfo.Status = "DS" Then GiveError (3309)
                                    
            'Update metric parameters
            Dim Parameters As BMC_Parameters
            Parameters = Get_BMCparameters(Me.BMC_ID)
        
            If Me.Combo_PartofDD = "No" Then
        
                Me.Cann = Parameters.Cann
                Me.Edited_cann = Parameters.Cann
                Me.PF = Parameters.PF
                Me.Edited_PF = Parameters.PF
            
            End If
 
            Me.AverageBMCPrice = Parameters.BMC_PriceAvg
            Me.AverageBMCMargin = Parameters.BMC_MarginAvg
            Me.VariableCostperUnit = Parameters.VarCost
            Me.Edited_VariableCostPerUnit = Parameters.VarCost
            Me.DirectHalo = Parameters.DirectHalo
 
            'Update estimated base volume to zero initially
            Me.ModelBaseVol = 0
 
            Dirty = False
 
            DoCmd.SetWarnings False
        
            'update uplift with structural modelling uplift predictions
            DoCmd.OpenQuery "T_160_q020_StructuralModeling_UPDATE"
        
            'updates cost as pct of buy for storage in temp table
            DoCmd.OpenQuery "T_220_q030_CostOfPromoStorage_PA_UPDATE"
        
            'updates subcat average price in temp table
            DoCmd.OpenQuery "T_250_q010_UpdateSubcatPrice_PA_UPDATE"
        
            'updates estimated base volume to correct values if the articles are present in table t_ArticleBaseVol_BaseVolOutput
            DoCmd.RunSQL "UPDATE t_ArticleBaseVol_BaseVolOutput INNER JOIN T_FPtr_InputTable_PriceAction_NEW ON (t_ArticleBaseVol_BaseVolOutput.article = T_FPtr_InputTable_PriceAction_NEW.Article) AND (t_ArticleBaseVol_BaseVolOutput.promoperiod = T_FPtr_InputTable_PriceAction_NEW.Promo_Period) SET T_FPtr_InputTable_PriceAction_NEW.ModelBaseVol = [t_ArticleBaseVol_BaseVolOutput].[period_baseline]"
            
            If Me.TenPctWeek_PropDiscount = 0 Then
            
                'update 10% day proportions
                Dim current_article As String
                Let current_article = Me.Txt_Article
            
                DoCmd.RunSQL "UPDATE T_FPtr_InputTable_PriceAction_NEW " _
                    & " INNER JOIN T_Static_024_10Day_Proportion ON T_FPtr_InputTable_PriceAction_NEW.BMC_ID = T_Static_024_10Day_Proportion.BMC_ID " _
                    & " SET T_FPtr_InputTable_PriceAction_NEW.TenPctWeek_PropDiscount = T_Static_024_10Day_Proportion.[10dayproportion] " _
                    & " WHERE (((T_FPtr_InputTable_PriceAction_NEW.Article)= val(" & Chr(34) & current_article & Chr(34) & ")));"
        
            End If
            
            DoCmd.SetWarnings True
            
            Me.Refresh
                        
            'update the cannibalisation and pullforward prices & margins to halfway between BMC_avg and article_price
            Call Update_Prices_CannPF
                        
    End Select
        
Exit_Txt_Article_LostFocus:
    Exit Sub
    
Err_Txt_Article_LostFocus:
    ApplicationError Err.Number, Err.Description, "Form_T_F020_InputTable_PriceAction\Txt_Article_LostFocus"
    Resume Exit_Txt_Article_LostFocus
 
End Sub

Open in new window

0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 1000 total points
ID: 23004134
You need to find out where the error is occurring.

Change your error handling to 'Break on all errors' and re-run and you will then get the problem line highlighted.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 23004137

Private Sub Txt_Article_LostFocus()

   ' On Error GoTo Err_Txt_Article_LostFocus    ' << COMMENT this line temporarily



repeat the operation when the error pops up hit DEBUG and see which line will be highlighted
 
0
 

Author Comment

by:jaisonshereen
ID: 23004220
yes i done it ..yellow background text is comming to

  Me.WEEE = ArticleInfo.WEEE_category
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 23004279
now check what should be the value for WEEE
and what is value showing in  ArticleInfo.WEEE_category
0
 

Author Comment

by:jaisonshereen
ID: 23004293
when i put cursor on   Me.WEEE value is 0 (zero)
0
 

Author Comment

by:jaisonshereen
ID: 23004322
ArticleInfo.WEEE_category=" "
0
 
LVL 77

Expert Comment

by:peter57r
ID: 23004335
Is that correct or not?
If it is not you have to look at the procedure called :
 Get_ArticleInfo()
to see how that value is being obtained.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 23004375
what is the validation for Me.WEEE ?


you can try this

Me.WEEE = nz(ArticleInfo.WEEE_category)

or

Me.WEEE = nz(ArticleInfo.WEEE_category,0)
0
 

Author Comment

by:jaisonshereen
ID: 23004432

Function Get_ArticleInfo(Article As Long) As ArticleInfo
On Error GoTo Err_Get_ArticleInfo
 
    'Returns the article information of the article id inputted and checks for blacklisting
    Set rst = CurrentDb.OpenRecordset("SELECT T_Static_019_ProductHierarchy.*, IIf([T_Static_038_ArticleBlacklisted].[Article]=[T_Static_019_ProductHierarchy].[Article],True,False) AS Blacklisted FROM T_Static_019_ProductHierarchy LEFT JOIN T_Static_038_ArticleBlacklisted ON T_Static_019_ProductHierarchy.Article = T_Static_038_ArticleBlacklisted.Article WHERE T_Static_019_ProductHierarchy.Article = " & Article)
 
    If rst.RecordCount = 0 Then
        
        Get_ArticleInfo.Found = False
    
    Else
        
        Get_ArticleInfo.Found = True
        
        Get_ArticleInfo.BMC_ID = rst.BMC_ID
        Get_ArticleInfo.Cat_ID = rst.Category_ID
        Get_ArticleInfo.Article_desc = rst.Article_desc
        Get_ArticleInfo.Subcat_ID = rst.Subcat_ID
        Get_ArticleInfo.Cost_current = rst.Cost_current
        Get_ArticleInfo.Price_current = rst.Price_current
        Get_ArticleInfo.Eire_current = rst.Eire_current
        Get_ArticleInfo.VendorNo = rst.Vendor_No
        Get_ArticleInfo.VendorName = rst.Vendor_Name
        Get_ArticleInfo.WEEE_category = rst.WEEE_category
        Get_ArticleInfo.Sites_listed = rst.Listing
        Get_ArticleInfo.Status = rst.Article_Status
        Get_ArticleInfo.Blacklisted = rst.Blacklisted
        
    End If
    
Exit_Get_ArticleInfo:
    Exit Function
 
Err_Get_ArticleInfo:
    
    'Null values cause errors - ignore
    If Err.Number = 94 Then Resume Next
    
    'Field name can't be found (maybe code is written ahead for future update) - ignore
    If Err.Number = 438 Then Resume Next
 
    ApplicationError Err.Number, Err.Description, "Module7\Get_ArticleInfo"
    Resume Exit_Get_ArticleInfo
    
End Function

Open in new window

0
 

Author Comment

by:jaisonshereen
ID: 23004448
This is the form
Article.jpg
0
 
LVL 77

Expert Comment

by:peter57r
ID: 23004488
There is no obvious problem with the code, although it is specifically allowing empty fields (nulls) to be accepted.

If the value of WEEE-category is not correct you have to look at the data in the table:
T_Static_019_ProductHierarchy
for the problem item and see if it 0 or empty.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 23004498
better if you can attach your db here. check Attach File below..
0
 

Author Comment

by:jaisonshereen
ID: 23005123
OK.. my actual problem is........ i am not leading to the on lost focus event....because of this error..is it any way to make it ?
0
 

Author Comment

by:jaisonshereen
ID: 23005131
i am not leading to the on lost focus event of Txt_Article
0
 

Author Comment

by:jaisonshereen
ID: 23005349
My problem is the below code is not executing in the above code which i posted, i need to make the control till the below code to execute
DoCmd.RunSQL "UPDATE T_FPtr_InputTable_PriceAction_NEW " _
                    & " INNER JOIN T_Static_024_10Day_Proportion ON T_FPtr_InputTable_PriceAction_NEW.BMC_ID = T_Static_024_10Day_Proportion.BMC_ID " _
                    & " SET T_FPtr_InputTable_PriceAction_NEW.TenPctWeek_PropDiscount = T_Static_024_10Day_Proportion.[10dayproportion] " _
                    & " WHERE (((T_FPtr_InputTable_PriceAction_NEW.Article)= val(" & Chr(34) & current_article & Chr(34) & ")));"
        

Open in new window

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question