Khalid-
If Rate contains a fraction, you need to declare varRate As Double or Single.
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On Jan 11, 2017, at 10:40 AM, Khalid Tanweer khalidtanweerburrah@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
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: John Viescas <johnv@msn.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
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