Unix Technical Forum

Create a view in VBA

This is a discussion on Create a view in VBA within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, Is it possible to create some SQL in VBA, 'run it' then view as a datasheet the results? ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 02:39 AM
Not Me
 
Posts: n/a
Default Create a view in VBA

Hi,

Is it possible to create some SQL in VBA, 'run it' then view as a datasheet
the results?

I'm trying to throw together a fairly large search form, and VBA seems the
best way to parse the parameters.

Cheers,
Chris


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 02:39 AM
Simon Hayes
 
Posts: n/a
Default Re: Create a view in VBA


"Not Me" <Not.Me@faker.fake.fa.kee> wrote in message
news:c6rag7$kt$1@ucsnew1.ncl.ac.uk...
> Hi,
>
> Is it possible to create some SQL in VBA, 'run it' then view as a

datasheet
> the results?
>
> I'm trying to throw together a fairly large search form, and VBA seems the
> best way to parse the parameters.
>
> Cheers,
> Chris
>
>


Yes - you could use the ADO COM objects, then return results to your client
and format/present them there. If you need a more precise answer, then it
would help to have some more detail about what you're trying to do and what
tools you're using (eg. Access, Excel etc.).

Simon


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 02:40 AM
Not Me
 
Posts: n/a
Default Re: Create a view in VBA

"Simon Hayes" <sql@hayes.ch> wrote in message
news:40913ac0$1_1@news.bluewin.ch...
> "Not Me" <Not.Me@faker.fake.fa.kee> wrote in message
> news:c6rag7$kt$1@ucsnew1.ncl.ac.uk...
> > Hi,
> >
> > Is it possible to create some SQL in VBA, 'run it' then view as a

> datasheet
> > the results?
> >
> > I'm trying to throw together a fairly large search form, and VBA seems

the
> > best way to parse the parameters.

>
> Yes - you could use the ADO COM objects, then return results to your

client
> and format/present them there. If you need a more precise answer, then it
> would help to have some more detail about what you're trying to do and

what
> tools you're using (eg. Access, Excel etc.).


Thanks for the reply.
In the past, I have been able to pre-write a query in Access, (i.e. have it
saved in the queries list) and use docmd.openquery in VBA to have it
displayed on screen.
I have also been able to create queries 'on the fly' in VBA, and be able to
iterate through them/work on them in the same program.
What I'd like to do is sort of combine the above, so create a query in VBA
and have it displayed in a datasheet view. So the user in an ADE would
select from a few comboboxes, press go and up would pop the resulting query.

Cheers,
Chris


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:53 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com