Search results

  1. M

    DSum for last month

    Beautiful. I only had to use the format function (EU dates here), and change the operator from less than or equal to greater than or equal to (who's interested can see code below). lastmonth = Format(DateSerial(Year(Date), Month(Date) - 1, 1), "\#mm\/dd\/yyyy\#") MyAvailable =...
  2. M

    DSum for last month

    I need to implement a new criterion in the following DSum, it now has to only sum the values for records that have a DataDecorrenza (that's a date field) not older than last month from Now(). I.e.: today's may 24, dsum must only consider records dated april 1st and older. As it turns June, only...
  3. M

    Subform field link

    Found the solution at http://www.pcreview.co.uk/forums/automation-object-error-t1143739.html Apparently the main form's record source SELECT tblsuch.* conflicts over a related field, or something like that.
  4. M

    Subform field link

    Main form's record source: SELECT Clienti_Ricette.*, Pagamenti.* FROM Clienti_Ricette, Pagamenti The subform is a datasheet meant to view and possibly enter new records in the table Pagamenti. subform's record source (from the afterupdate of a cbo in the main form): mysql = "SELECT Pagamenti.*...
  5. M

    Aggregate subtraction with a few rules

    My payment table has a "mode" field set up for the purpose, I hope it's enough to get the job done :)
  6. M

    Aggregate subtraction with a few rules

    Thanks for your reply Guus2005, though I'm not sure I can get there so easily. jzpw22, I agree with your approach, and am thinking that if this feature is such a pain I'll just stick with the subtraction of sumPayments from sumPresWorths and cut to the chase. If the prescription worth doesn't...
  7. M

    Table design flaw?

    As always, thank you for your time jzpw22 - your help is always invaluable and when I address you as mentor I do mean it (I barely knew how to open access a couple months ago). The solution you provided basically does the DSum I used to run in VBA with SQL, but I have explained what I'm trying...
  8. M

    Aggregate subtraction with a few rules

    After following all the mandatory steps in my "before posting steplist" (research, experiment, further research, frustration, further experiment, utter failure), I decided I'd ask you guys. The task at hand is the following: table1 AS t1 has the presWorth (currency) field; table2 AS t2 has the...
  9. M

    Table design flaw?

    I was wondering if a thing such as a "hybrid source" listbox might exist, but I reckon it does not. I wanted to use vba for calculations as I'm slightly more familiar with it than SQL. The simple textbox showing the residue I have obtained with MyAvailable = Nz(DSum("ValoreRicetta"...
  10. M

    Table design flaw?

    The answer was so simple, yet so elusive to me. Thanks for the enlightening as usual, my mentor :) I had a listbox that used the (now gone) residue field, among others, as row source. I'm given to understand once the rowsourcetype property of the listbox is set to "table/query", you can't have...
  11. M

    Table design flaw?

    I decided there's a flaw in my table design after several days of inability in solving a problem with the "residue" field in one of my tables. I have the following situation: Some customers have prescriptions which come - for those eligible -, each month, in various worths. They give these...
  12. M

    Saving SQL results into array for calcs

    I have been halted by the flu, but as I eventually got back to it I have now spent several hours trying to figure this out without any luck. Would you be able to put up an example of the SQL I need to perform the subtraction successfully?
  13. M

    Saving SQL results into array for calcs

    Thanks for the info, i'll give it a shot tomorrow as i get back to it!
  14. M

    Saving SQL results into array for calcs

    How would I write the instruction to look for and subtract from the check with less money on (and keep track of the fact that said amount must be subtracted both from that check AND from the "AmountDue" field in tblPayments)?
  15. M

    Saving SQL results into array for calcs

    both tabls have fkCustomerID
  16. M

    Saving SQL results into array for calcs

    I have a table with checks of different worths and customers can place orders and use part of said checks to pay over time. ex. tblChecks: check1-worth 50€ check2-worth 20€ tblPayments: order1-worth 25€ I want that 25€ be subtracted first from check2 leaving it at 0, and the remaining 5 from...
  17. M

    DSum and values in different records

    Ok this is now complete, though still at a prototype state. Should anyone need the routine for such a messy calculation, here goes: Private Sub cmdAggiornaResiduo_Click() 'variables for availability calculations Dim disp As Single Dim totPagamenti As Single Dim sforo As Single 'variable for...
  18. M

    Update query with two conditions

    ok I solved this with the replace function. Should anybody else be in the same waters I was in, check these links for refernece: http://www.tek-tips.com/viewthread.cfm?qid=1600948&page=2 http://www.techonthenet.com/access/functions/string/replace.php
  19. M

    Update query with two conditions

    I changed the variable types form currency to integers and that did the trick. Thank you so much I keep forgetting of the little nuisances of conversion between EU and US notation. Edit: Actually, no, that means the values are truncated and rounded to integers :/
  20. M

    Update query with two conditions

    Right! Since I'm running this from VBA with mySQL = "UPDATE Clienti_Ricette " & _ "SET Residuo = Residuo - " & sforo & _ " WHERE [Residuo] >= " & sforo & _ " AND [IDCliente] = " & Me.IDCliente Debug.Print mySQL DoCmd.RunSQL...
Back
Top Bottom