How to use SQL variables in VBA



Hello, I have the following SQL code:

DECLARE draw_num2 int

SELECT draw_num2 = max (draw_num)+ 1 --THIS LINE IS MY PROBLEM
FROM hdx_housing_assign_master

I want to execute this code in Access VBA, however, I am having a
problem understanding how to accomplish this same task in VBA. My
problem is that the variable is manipulated within the SQL statement
and I do not know how to re-produce that functionality in VBA.

Thanks for Your Help,
Matt

.



Relevant Pages

  • Re: How to use SQL variables in VBA
    ... I want to execute this code in Access VBA, however, I am having a ... problem understanding how to accomplish this same task in VBA. ... problem is that the variable is manipulated within the SQL statement ...
    (microsoft.public.access.queries)
  • File Copy / Save in Access: Is it Possible?
    ... My manager threw out the gaunlet and I'm at a loss how to accomplish ... While having Access open, locate a file on the network, ... programming at all (I just bought the book "Access 2003 VBA ... Canned software designed to do this in an Access environment ...
    (comp.databases.ms-access)
  • RE: Apply Border based on last Day of Month
    ... "Bill" wrote: ... > I need to accomplish two tasks using VBA for Excel. ... > CL would also have a thick border applied to the right side since BH3 and CL3 ...
    (microsoft.public.excel.programming)
  • Auto-populate PowerPoint Slides
    ... I need to automatically create 105 PowerPoint presentations and need ... some advice on tools available and/or VBA ... My initial thought would be to create an Excel spreadsheet (could be ... Are there tools or add-ins out there that could accomplish this for me? ...
    (microsoft.public.powerpoint)
  • Re: Problem with Access
    ... Sorry but isn't there a Newsgroup for Access VBA? ... Jan De Messemaeker, Project MVP ... an error message about type of my variable. ...
    (microsoft.public.project.vba)