Something like:
Select cast(year(MyDateField) as varchar) + cast(month(MyDateField) as varchar) as Month,
count(Sales) as SalesTotal
From MyTable
Where MyDateField > 'Whatever Date'
Group By cast(year(MyDateField) as varchar) + cast(month(MyDateField) as varchar)
Should do it I think
I'd say the easiest way would be to unbind the fowm from the table and then set the save record button code to something like:
dim db as database
dim rs as recordset
set db = currentdb
set rs = db.openrecordset("MyTable1")
with rs
.addnew
!MyField1 = txtbox1
!MyField2 = txtbox2...
Can't see your spreadsheet but do you just want a formula to stick in an extra column to make the counting easier or a big array formula to calculate the whole thing in one go?
If the former then something like this should give you a 1 or a 0 for those who arrived early so you can run a count...
That's the way continuous forms work. Remember that you only have one checkbox. You can see lots of them on the screen but they are all the same checkbox so you can't have some enabled and some not.
Yes you could generate the tables with that spreadsheet.
It's hard to know exactly how to code it without seeing the layout of your data though so post it up, also have a read up on Tabledefs in VBA help and on this forum as a starting point.
Yup, it's normal for dynamic ranges not to be listed in the edit>>goto box. If you reference it through VBA or if you type the range name into the cell reference box at the top left they'll work though.
Ah, misunderstood your question, thought you were trying to copy a range with the same name from one WB to another and paste as values rather than just pasting an existing range as values within 1 WB.
Hi,
You need to tell it which workbook the names are in. Try something more like this:
Dim WB As Workbook
Set WB = Workbooks.Open(Prev_PSC_Filename)
WB.Range("Previous_PSPD").Copy
ThisWorkbook.Range("Previous_PSPD").PasteSpecial xlPasteValues
WB.Close SaveChanges:=False
Set WB = Nothing
Chance,
I've temporarily removed the call to the GetDataCol function so that's not the issue. All error handling has been removed while testing and no errors have been thrown out.
And yes I am changing a cell on the same worksheet the change event is firing from, that's why it disables events...
Aha, you're right it is firing to the XLDateAdd function first. Yes I do have Indirect and Offset being used in the workbook and thinking about it some of those indirects will be referencing the cells in question.
Any ideas on why this is cauing a problem only in certain circumstances? I've...
Geoff,
No the cell in question isn't referenced by any formulas at all, neither is the cell I'm changing to fire the event and the whole procedure runs perfectly when values are typed into the cell.
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.