|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
I would like to show the data from a recordset in a query.
Is it possible? how can i do?
thanks, JP
|
|
Hi, what do you mean with query? query you can build on table or other query, recordset you can sort, filter
-- Best regards, ___________ Alex Dybenko (MVP) http://alexdyb.blogspot.com http://www.PointLtd.com
"Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message news:D413C705-343E-4A62-8FE5-5C27012FD1EE[ at ]microsoft.com...
[Quoted Text] >I would like to show the data from a recordset in a query. > > Is it possible? how can i do? > > thanks, > JP
|
|
I mean query the term tha we use in ms access. I'm using ms access 2003 and there you have, tables, queryes, forms, entc.
The question is.
I create a recordset using for example the following code Dim rec As ADODB.recordset DIM strSQL as String Set rec = New ADODB.recordset strSQL ="SELECT * FROM Customers rec.Open strSQL, CurrentProject.Connection
-- now I need the code to show the data existing in rec (rec - recordset) in a query or in a form
What can I do?
Thanks,
JP
"Alex Dybenko" wrote:
[Quoted Text] > Hi, > what do you mean with query? query you can build on table or other query, > recordset you can sort, filter > > -- > Best regards, > ___________ > Alex Dybenko (MVP) > http://alexdyb.blogspot.com> http://www.PointLtd.com> > "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message > news:D413C705-343E-4A62-8FE5-5C27012FD1EE[ at ]microsoft.com... > >I would like to show the data from a recordset in a query. > > > > Is it possible? how can i do? > > > > thanks, > > JP > >
|
|
Hi, then you can create a form, bind this recordset to form and show it. Look at Recordset Property in Access help for more info
-- Best regards, ___________ Alex Dybenko (MVP) http://alexdyb.blogspot.com http://www.PointLtd.com
"Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message news:6B5A6DE0-780B-4810-B0BE-848404E286E9[ at ]microsoft.com...
[Quoted Text] >I mean query the term tha we use in ms access. > I'm using ms access 2003 and there you have, tables, queryes, forms, entc. > > The question is. > > I create a recordset using for example the following code > Dim rec As ADODB.recordset > DIM strSQL as String > Set rec = New ADODB.recordset > strSQL ="SELECT * FROM Customers > rec.Open strSQL, CurrentProject.Connection > > -- now I need the code to show the data existing in rec (rec - recordset) > in > a query or in a form > > What can I do? > > Thanks, > > JP > > "Alex Dybenko" wrote: > >> Hi, >> what do you mean with query? query you can build on table or other query, >> recordset you can sort, filter >> >> -- >> Best regards, >> ___________ >> Alex Dybenko (MVP) >> http://alexdyb.blogspot.com>> http://www.PointLtd.com>> >> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message >> news:D413C705-343E-4A62-8FE5-5C27012FD1EE[ at ]microsoft.com... >> >I would like to show the data from a recordset in a query. >> > >> > Is it possible? how can i do? >> > >> > thanks, >> > JP >> >>
|
|
hi Jose,
Jose Perdigao wrote:
[Quoted Text] > I create a recordset using for example the following code > Dim rec As ADODB.recordset > DIM strSQL as String > Set rec = New ADODB.recordset > strSQL ="SELECT * FROM Customers > rec.Open strSQL, CurrentProject.Connection > > -- now I need the code to show the data existing in rec (rec - recordset) in > a query or in a form > > What can I do?
http://support.microsoft.com/?scid=kb%3Ben-us%3B281998&x=3&y=10
mfG --> stefan <--
|
|
I know this code, it works if the there is textbox and if the cotrolsource is matching with the fields of recordset. That's why, i ask to show the recordset in queries
By another words, how can I show the recordset if the fields of recordset is changing (names and number of the fields)? Is it possible?
Another question. - I know to bound a recordset to a form (if the texts box is matching to the recordset fields) -I know to bound a recordset to a listbox or combo box.
Question. How can I bound a recordset to a chart in MS Access 2003?
Thanks,
JP
"Stefan Hoffmann" wrote:
[Quoted Text] > hi Jose, > > Jose Perdigao wrote: > > I create a recordset using for example the following code > > Dim rec As ADODB.recordset > > DIM strSQL as String > > Set rec = New ADODB.recordset > > strSQL ="SELECT * FROM Customers > > rec.Open strSQL, CurrentProject.Connection > > > > -- now I need the code to show the data existing in rec (rec - recordset) in > > a query or in a form > > > > What can I do? > > http://support.microsoft.com/?scid=kb%3Ben-us%3B281998&x=3&y=10> > > > mfG > --> stefan <-- >
|
|
hi Jose,
Jose Perdigao wrote:
[Quoted Text] > I know this code, it works if the there is textbox and if the cotrolsource is > matching with the fields of recordset. > That's why, i ask to show the recordset in queries
Use alias names for the fields, bind these aliases to your controls.
> By another words, how can I show the recordset if the fields of recordset is > changing (names and number of the fields)? > Is it possible? Don't use the * in your SQL statment.
E.g.: SQL = "SELECT Field1 AS Bound1, Field2 AS Bound2 FROM..."
> Question. > How can I bound a recordset to a chart in MS Access 2003? Same trick. Use aliases.
mfG --> stefan <--
|
|
Thanks Stefan by suggestions. Unfortunately doesn't work properly. When I change the recordset, the heads names are the same. Another problem, if the controls are less than fields what can I do?
I think the best solution is, open new form and create programmatically the number of controls matching with the fields name and with the number of fields. But I don't know how I can create controls programmatically. Do you have suggestions? Thanks
JP
"Stefan Hoffmann" wrote:
[Quoted Text] > hi Jose, > > Jose Perdigao wrote: > > I know this code, it works if the there is textbox and if the cotrolsource is > > matching with the fields of recordset. > > That's why, i ask to show the recordset in queries > Use alias names for the fields, bind these aliases to your controls. > > > By another words, how can I show the recordset if the fields of recordset is > > changing (names and number of the fields)? > > Is it possible? > Don't use the * in your SQL statment. > > E.g.: > SQL = "SELECT Field1 AS Bound1, Field2 AS Bound2 FROM..." > > > Question. > > How can I bound a recordset to a chart in MS Access 2003? > Same trick. Use aliases. > > > mfG > --> stefan <-- >
|
|
|