if that's access 2013 I can't read it until monday.



The SQL code is selecting all records where the SPONSORID matches your hidden text field, the COUNTERPARTYID matches what's selected in your list box and the YY field matches the year selected.

the results are not displayed, it is just a 'virtual' query that you can open using

db.openrecordset (ssql)

If you limit your data set when you select a counterparty you can easily look up the month, match it to a field (you're already doing something very similar in your code) and populate it accordingly, in this case you would match the MM field (1 through 12) to the CONTROL on your form that's MONMM (Mon1 through Mon12) using dlookup or cycling through controls using something like

Code:
dim ctl as control

for each ctl in me.controls
    If left(ctl.name,3) = "MON" then
        'parse out the month number from the control name, then look up the value from your 'virtual' dataset
    else
        'don't do whatever else you're going to do 
    endif
next ctl
If you've solved the problem of adding 12 records every time you click your button, regardless of whether records exist or not then you don't need the last part with the recordcount. I was simply stating you could determine whether or not a sponsor/counterparty/year had records already or not this way, if it didn't (recordcount =0) then you could go through your add records loop, otherwise don't.