Okay, quick status update: things are looking good! Carried out additional testing, different examples, different amounts, records in both Sterling and Euro currencies, using both UK and Italian region settings... haven't ran into any other issues.
My sincerest thanks to MajP and Josef. P for...
Yeah, the immediate window for this gave:
? str(4.25) * 1
425
It will return 4.25 after I implement Josef P.'s recommendation above though.
I see that suggestion makes use of a Replace command, attempting to manually swap out commas with decimal points. I know a colleague of mine (who...
Okay, after going through both MajP & Josef P.'s last posts, we may finally be making some progress. What I've now got is this:
Dim strSql As String, strSql2 As String
Dim dblODHaulageRate As Double
dblODHaulageRate = Me.txtEditHaul
strSql = "UPDATE [Order Details] SET ODHaulageRate = " &...
Sorry, MajiP, I'm trying to wrap my head around your suggestion here. Is this the sort of thing you mean?
Main = (" & CCur(Me.txtEditHaul) & ")
MainAndPallets = (" & CCur(Me.txtEditHaul * Me.ODPallets) & ")
MainAndQty = (" & CCur(Me.txtEditHaul * Me.ODQty) & ")...
Okay...
So you're right: trying to print Val(4,25) in the Immediate window also gives me wrong number of arguments or invalid property assignments.
If I try ?Val(txtEditHaul) it returns 4 and if I try ?CDec(txtEditHaul) it returns 4,25
So it may be that Val is the wrong way to go here...
Hello again all,
We have a form with a text box called txtEditHaul (format is Fixed) and when a user types a figure in this field it needs to update a couple of Currency fields in a table. This is the original VBA code in the After Update of the box:
DoCmd.RunSQL ("UPDATE [Order Details] SET...
Just to provide an update on this one: what I ended up doing was using the Val function on the result, e.g. Round(Val([TOTAL]),2). Banker's rounding now seems to work as expected - incredible!
My thanks again to all who kindly took time to offer their suggestions.
Isaac, you may have hit the nail on the head here! Alas, I don't have the ability/authorisation to change the data type on the existing ODPrice field. But what I have managed to do in the latest test is this:
Create two new fields in the Order Details table: ODPriceTN (with data type Number)...
Hi all. Thanks to everyone for their input thus far. I won't lie: some of it goes over my head at the moment (still pretty new to Access coding as a whole), but I will persevere.
So this is being done in a select query behind a report. I can certainly post the entire query if you'd like...
Hello all,
I am currently trying to grapple with the Round function in Access. I should start by saying that I know Access uses "banker's rounding" and this is actually what I want it to do, however I am finding that even this doesn't appear to be functioning as I want it to.
For example...