Re: How do I load data from a select query into an Array in VBA co

Tech-Archive recommends: Fix windows errors by optimizing your registry



BlueWolvering <BlueWolvering@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Ok, I suppose it's not NON Negotiable. My skill set is still a little
limited with VBA for access, though I'm pretty good with VBA for Excel. I
feel comfortable with VBA, but less so with the ACCESS specific stuff.

The differences between VBA for Excel and Access are negligible except
for the Excel/Access specific stuff. Which obviously can be
significant. But easily doable.

I am going to proceed with the method you suggest.

Here's what I need to do with data and you can tell me if there's a better
way.

I need to pull date's from the select query (3 fields) and compare them
against each other and today's date.

There might be ways of doing this in queries so that you can have just
one Update query doing the whole thing. Depending on the complexity
of the logic, etc, etc.

After that I have to extract the other
fields and insert them into a string that will be the text for an sql update
query. All this is done in VBA. Are arrays a good way to store this or is
there a better way?

For each record you are reading in are you then making a decision and
then updating a record? Nothing depends on data from multiple
incoming records?

If that's the case then just use variables inside the recordset
looping logic previously mentioned and update each record in the loop.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
.



Relevant Pages

  • Re: Change a querys SQL code from excel
    ... insdead of a VBA group. ... suitable for Excel VBA. ... SQL that runs a query in access. ... Dim RS As DAO.Recordset ...
    (microsoft.public.vb.com)
  • Re: Use MS Query in VBA to only get a SQL statement
    ... Excel macro keeps running while the query grid is showing, ... how you would capture the sql. ... > Access database under VBA control, where you could bring up a new ...
    (microsoft.public.excel.programming)
  • Re: VBA errors in 2007 (works fine in 2003)
    ... It's just breaking on the Mac version of Excel. ... Pak allowing you to call functions in the ATP from within VBA. ... menu in VBA, choose References, and select "atpvbaen.xls". ... If there is the possibility of a name collision (two or more libraries ...
    (microsoft.public.excel.misc)
  • Re: VBA errors in 2007 (works fine in 2003)
    ... The file is working as intended now in Excel 2003 and 2007. ... Pak allowing you to call functions in the ATP from within VBA. ... menu in VBA, choose References, and select "atpvbaen.xls". ... If there is the possibility of a name collision (two or more libraries ...
    (microsoft.public.excel.misc)
  • VBA usign predefined SQL over SQL server database
    ... New Database Query) from Excel VBA ... I need to run the query from the macro attached to a button in Excel as I ... do I have to define the SQL etc from scratch in VBA? ...
    (microsoft.public.excel.programming)