Rabu, 11 Januari 2017

[MS_AccessPros] Not getting correct "Rate" values

 

Hi John,

Hope you will be fine with good health.

I have to make some changes in PCTL database due to the demand of my previous boss, he is now himself using this database having PCTL_be.accdb & PCTL.accde on his Laptop. On his request i sometimes make changes and additions as per his requirements due to current demands and requirements of his business.

Now his demand was to insert/add an ID in form "CollectionVoucher" for field "ProductNameEnglish"

Before in table "Products" field "ProductNameEnglish" was PK, now i added field "ProductID" and is PK now. (Number-->Long Integer-->Decimal Places 0). I deleted all relationships for "ProductNameEnglish" and replaced with "ProductID". Up to now my workings on changes are OK. I was stucked at some points but tried to resolve them by myself, instead of bothering you on those.

But now i am stucked in form "CollectionVouchersubform" data entry at one point. (Link Master/Child field is ConsignmentNo"). At field "Rate" On Got Focus event it is NOW not giving correct value. The event is:

Private Sub Rate_GotFocus()
    If IsNull(WeightOfCarton) Then
        MsgBox "Oops you forget to enter Weight Of Carton." & vbCrLf & _
        "Please enter Gross Weight." _
        , vbExclamation, "PCTL - Missing Entry"
        WeightOfCarton.SetFocus
    End If

    Dim varRate As Integer <==== Before it was Varient

    varRate = DLookup("DestinationRate", "tblDestinationRates", _
        "Destination = '" & Me.cmbDestination & _
        "' AND ProductID = " & Me.ProductID & "") <==== Before it was "ProductNameEnglish"
    Me.Rate = Nz(varRate, 0)
End Sub

Now value for "Rate" is displaying 3.00 for any "ProductID" though they are different for each "Destination" ---> ProductID" in "tblDestinationRates". There is no Default Value set for field "Rate".

Could you please figure it out and help.

Regards,
Khalid


__._,_.___

Posted by: Khalid Tanweer <khalidtanweerburrah@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar