There's a kind of query called a summary query - if you run Access's Query Wizard you should be able to figure out what to do from there, or you can just push the totals button in the query designer (the greek sigma symbol) and select 'sum' for the 'amount downloaded' field.
Cheers
K
The simple answer (I don't know if there's a more elegant one) would be:
Totals: Iif(IsNull[field1],0,[field1] + Iif(IsNull[field2],0,[field2] + Iif(IsNull[field2],0,[field2];
This *should* work but it's off the top of my head. Look in VBA's help under 'iif' for its correct syntax if not...
Well, I hacked together a solution for myself by poking around on MSDN:
Dim RemoteApp As Access.Application
Set RemoteApp = CreateObject("Access.Application")
RemoteApp.OpenCurrentDatabase <filename>
RemoteApp.DoCmd.<whatever>
RemoteApp.CloseCurrentDatabase...
OK, with a bit of poking around, I now have the following code scrap:
docmd.selectobject acQuery, <query name>, true
docmd.runcommand accmdnewobjectautoform
...which does what I want. Yay! But, can I get another database (ie not the current open one) to create the form?
I guess I'm asking if...
mp9 -
Investigating your method turns up the following chunk of code:
Dim dbs As Database
Set dbs = OpenDatabase(CurrentDb)
dbs.Execute "CREATE TABLE ThisTable " & "(FirstName CHAR, LastName CHAR);"
dbs.Close
(Dumb newbie question): Database is not...
Hello. I would very much like to be able to create tables in Access's VB, beyond the use of 'runcommand acCmdNewObjectTable', ie. I would like to be able to specify, in VB, the attributes of each field. Is this even possible in Access or should I go use MySQL/C++?
Thanks a lot.
Kendrick
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.