2113 value you entered isnt valid

 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
jaisonshereenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jaisonshereenAuthor Commented:
i entered 75644

please see the properties
Properties.jpg
0
jaisonshereenAuthor Commented:
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

peter57rCommented:
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
Rey Obrero (Capricorn1)Commented:

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
jaisonshereenAuthor Commented:
yes i done it ..yellow background text is comming to

  Me.WEEE = ArticleInfo.WEEE_category
0
Rey Obrero (Capricorn1)Commented:
now check what should be the value for WEEE
and what is value showing in  ArticleInfo.WEEE_category
0
jaisonshereenAuthor Commented:
when i put cursor on   Me.WEEE value is 0 (zero)
0
jaisonshereenAuthor Commented:
ArticleInfo.WEEE_category=" "
0
peter57rCommented:
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
Rey Obrero (Capricorn1)Commented:
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
jaisonshereenAuthor Commented:

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
jaisonshereenAuthor Commented:
This is the form
Article.jpg
0
peter57rCommented:
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
Rey Obrero (Capricorn1)Commented:
better if you can attach your db here. check Attach File below..
0
jaisonshereenAuthor Commented:
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
jaisonshereenAuthor Commented:
i am not leading to the on lost focus event of Txt_Article
0
jaisonshereenAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.