PC Review


Reply
Thread Tools Rate Thread

How to display recordset in datasheet view

 
 
Rick
Guest
Posts: n/a
 
      19th Sep 2003
For testing purposes I would like to see a datasheet of the records returned
from a select query. I am using Access2000, DAO.
For example, the following:
strsql = "SELECT Clients.ClientID, Clients.RegistrationDate,
Clients.BabyActualDate, Clients.Father" _
& " FROM Clients" _
& " WHERE (((Clients.RegistrationDate)<" & dteFYStart & "));"
Set rstClients = dbsBITO.OpenRecordset(strsql)

Thank you for your advice.
Rick


 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      19th Sep 2003
"Rick" <(E-Mail Removed)> wrote in message
news:K4Jab.506345$(E-Mail Removed)...
> For testing purposes I would like to see a datasheet of the records returned
> from a select query. I am using Access2000, DAO.
> For example, the following:
> strsql = "SELECT Clients.ClientID, Clients.RegistrationDate,
> Clients.BabyActualDate, Clients.Father" _
> & " FROM Clients" _
> & " WHERE (((Clients.RegistrationDate)<" & dteFYStart & "));"
> Set rstClients = dbsBITO.OpenRecordset(strsql)


If it's just for your own testing add a line ...

Debug.Print strsql

....after assigning the string. Then you can copy the assembled SQL from the debug
window into a new query and see if it works as expected.


 
Reply With Quote
 
Rick
Guest
Posts: n/a
 
      19th Sep 2003
Thank you Rick ...

"Rick Brandt" <(E-Mail Removed)> wrote in message
news:bkfn8k$1blvi$(E-Mail Removed)...
> "Rick" <(E-Mail Removed)> wrote in message
> news:K4Jab.506345$(E-Mail Removed)...
> > For testing purposes I would like to see a datasheet of the records

returned
> > from a select query. I am using Access2000, DAO.
> > For example, the following:
> > strsql = "SELECT Clients.ClientID, Clients.RegistrationDate,
> > Clients.BabyActualDate, Clients.Father" _
> > & " FROM Clients" _
> > & " WHERE (((Clients.RegistrationDate)<" & dteFYStart & "));"
> > Set rstClients = dbsBITO.OpenRecordset(strsql)

>
> If it's just for your own testing add a line ...
>
> Debug.Print strsql
>
> ...after assigning the string. Then you can copy the assembled SQL from

the debug
> window into a new query and see if it works as expected.
>
>



 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      20th Sep 2003
"Rick" <(E-Mail Removed)> wrote in
news:K4Jab.506345$(E-Mail Removed):

> For example, the following:
> strsql = "SELECT ClientID, RegistrationDate, " & _
> " BabyActualDate, Father " & _
> "FROM Clients" & _
> "WHERE RegistrationDate<" &
> Format(dteFYStart, "\#yyyy\-mm\-dd\#") & ";"


' Create a qerydef to hold it
' Actually, making it a parameter query would make the whole
' lot a bunch easier...
Set qdf = dbsBITO.CreateQueryDef("rnsTemp", strSQL)

' show it for debugging
DoCmd.OpenQueryDef "rnsTemp"

' Ask the user if it looks right: but out if it doesn't
If MsgBox("OK???",vbYesNo) <> vbYes then
Exit Sub
End If

' Okay, now open it as a recordset
Set rstClients = dbsBITO.Querydefs("rnsTemp").OpenRecordset _
dbOpenSnapshot, dbForwardOnly


' other stuff here, and then don't forget to
dbsBITO.QueryDefs.Delete "rnsTemp"


Hope that helps


Tim F

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display Row Number in Datasheet View garvic82 Microsoft Access Database Table Design 3 11th Feb 2010 09:01 PM
How do I display checkboxes in datasheet view? =?Utf-8?B?R3JlZyBXZXR6ZWw=?= Microsoft Access Database Table Design 5 14th Mar 2006 12:33 AM
Query in datasheet view yields different results than opening it as a recordset Jason Seaver Microsoft Access Queries 3 7th Jul 2004 05:00 PM
Display font size for DataSheet view Kevin Microsoft Access Form Coding 2 12th Jan 2004 04:01 PM
DataSheet view with ADODB.Recordset andre Microsoft Access Form Coding 0 29th Sep 2003 04:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:13 PM.