I like the direction others have pointed you in. I think a hybrid of both Hneal98's and PHV's might work well for you:
Sub testfunct()
Dim MyString As String
Dim MyName As String
Dim MyPhone As String
Dim BreakLoc As Integer
Dim rsFixFullName as DAO.Recordset
Dim strSQL As String...
What is the original source of the data?
I've seen problems like this with data imported from a text source, where the import specs didn't appropriately account for how the fields were delimited in the text file...
We may be talking about two different things. The book value in accounting actually refers to undepreciated cost of a fixed asset at a given point in time - not the "blue book" value. Moreover, depreciation is calculated from the actual cost of an asset - not its value - from the time you...
Like PHV said:
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim strSQL As String
strSQL = "SELECT * FROM Orders o WHERE o.[OrderID] = 9999"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
If (rs.BOF And rs.EOF) Then
MsgBox "rst empty..."
End If
Raskew has a point about the DateDiff. However, you should also consider typical accounting practices for your put in service date.
Typically, if you put an asset in service the 1st half of the month, you can calculate its accumulated depreciation the same as if you put it in service on the...
Sorry, I didn't piece everything together to understand what you needed until I read your last couple of responses. As I now understand it, you want an automated means of calculating the declining book value (i.e. cost minus accumulated depreciation) for a given month. Therefore, Remou's...
You say that you are opening the second database to run a function in it? Do you also require data from the tables in the second database?
I agree with EasyIt's post; don't use another application object. Instead, you might work with a workspace object, create two database objects, assign the...
There are two VB financial functions that I believe you could use here: SYD (for Sum of Years'Digits depreciation method) and SLN (for Straight Line depreciation - probably fits better for your example).
SYD takes 4 arguments:
cost (i.e. initial cost of object)
salvage (i.e...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.