Search results

  1. stopher

    VBA code/array to solve data set

    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...
  2. stopher

    VBA code/array to solve data set

    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...
  3. stopher

    Data type mismatch in criteria expression error

    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...
  4. stopher

    What Next ?

    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...
  5. stopher

    What Next ?

    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...
  6. stopher

    If then statement help

    Create a table with all your variants then either do a lookup or create a join query.
  7. stopher

    Don't add a record if exists(via VBA)

    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.
  8. stopher

    Don't add a record if exists(via VBA)

    Create an index in your table based on two fields - Name & Age and set no duplicates.
  9. stopher

    Don't add a record if exists(via VBA)

    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?
  10. stopher

    Don't add a record if exists(via VBA)

    Just set your key field in your table to no duplicates allowed. Then you can append all you like, the duplicates won't get added.
  11. stopher

    on Load

    Remove the .value or replace it with .text
  12. stopher

    on Load

    I think you should use the On Current event.
  13. stopher

    Expression Error in IIF statement

    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.
  14. stopher

    Aging receivable

    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...
  15. stopher

    Charts and Graphs in Access

    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 =...
  16. stopher

    Goodbye, Object Oriented Programming

    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...
  17. stopher

    Looping Through Recordset

    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...
  18. stopher

    Creating Table field based on field in another table

    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...
  19. stopher

    Search in fields with allowed multiple Values

    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...
  20. stopher

    Creating Table field based on field in another table

    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).
Back
Top Bottom