The problem makes more sense now. So this is a Linear Programming problem and you used Solver (LP Simplex) to solve. So yes you can write VBA to solve LP problems. It's easy to write such code in VBA. What is not so easy is understand the LP Simplex algorithm in order to write the code...
If I read the problem right, then this is easy to do in your head...
Let's take the Hilton. There are 4 Hilton hotels. And I have to stay in a Hilton for a minimum of 4 nights. So I just stay one night in each - job done. There's no point staying in any Hilton any longer because I'm not...
I agree with CJ_London's solution as a better way forward. What I don't understand though is why the OPs solution doesn't work. I'm wondering if the syntax of the time stamp is not in a format that Datevalue can interpret. This would cause the offending Data type mismatch.
What data type is...
While this is true of a relational database, it certainly isn't true of all types of database.
Typically you will build a data warehouse that DOES store aggregates at various levels. Server based engines are well suited to updating and making available such databases. Once the databases are...
Reminds me of the part in Alice in Wonderland where Alice comes to a fork in the road and has a dialogue with the Cheshire Cat...
“Would you tell me, please, which way I ought to go from here?”
“That depends a good deal on where you want to get to,” said the Cat.
“I don’t much care where–” said...
Why do you think that? Sure if you create two separate indexes - 1 for name and one for age then what you say above will happen. But if you create a single index based on both fields then both field would have t match for them to be rejected.
You can create an index (no duplicates) on multiple fields.
But I don't understand your logic. You final table includes Mary 36 twice and Peter 29 twice. And what happened to Fred?
Most likely you are trying to list this expression in your query but you haven't included it in the group by clause.
Please post the rest of your query.
Hi and welcome to the forum.
Change the Qout in Q1 to:
Qout: Nz(DSum("debt","GLtrans","[accunt_id]=" & [accunt_id] & " and [Opdate]<=#" & Format([Opdate],"mm/dd/yyyy") & "#"),0)
The format bit in the middle is to ensure the date is treated in US format. The ## are to tell the query that the...
Or use the Excel regression functions e.g. LINEST
Public Sub test()
Dim oXL As Excel.Application
Set oXL = CreateObject("Excel.Application")
Dim x()
Dim y()
Dim r()
x = Array(1, 2, 3, 4, 5)
y = Array(2, 6, 6, 6, 10)
r =...
Yes, an interesting article.
I'm an amateur programmer so probably a bit naive as to the wider implications of particular paradigms. However, here's my views:
Inheritance
The writer sites the virtue of inheritance as "reuse" i.e. I'll take this code and use it elsewhere. But that's not the...
I'll explain what your code is doing.
You have assigned rst to tblLaborCost8. So when your loop starts, it will loop through every record in this table regardless of the records in your form.
Inside the loop you have statements that are updating values of the current record in the form. The...
Sure. Either create a query with all the fields you need in your report. Then set the report data source to the query instead of the table.
Or double click on the data source in your report which will probably ask you if you want to create a query. This will open the query designer showing...
Multi-valued fields can be more hassle then they are worth. If you are creating a field that has values that you are likely to perform some task on e.g. search, join, then I would strongly advise creating another table to store the values (1 to many).
Nevertheless, you should be able to set a...
You should not create a field in your main table. Instead, you create a query which allows you to view data from two or more tables joined by the appropriate key(s).