When row source sql saved as a query it stops working (1 Viewer)

boblarson

Smeghead
Local time
Today, 12:31
Joined
Jan 12, 2001
Messages
32,059
Hi Wiklendt and Bob,

Sorry I haven't replied earlier, I've got a vineyard here in Oz and we're right in the middle of harvest so have been picking grapes for the last week.

Thanks for looking at this, I guess sometimes you just need to accept that somethings can't be done.

I have tried the rowsource method suggested by Bob as what I'm ultimately trying to do with this graph is place a data label on some plot points and not others. When I open the recordset in vba using Graph27.rowsource I get too few parameters message so was wanting to be able to rewrite the query programatically for the graph rowsource to eliminate the too few paramters message but as I can't save it as a name I don't know how to get the recordset open without the parameter message.

Hope this makes sense.

Kind regards,

Rachael
I'll revisit it and see if I can figure that out for you.
 

wiklendt

i recommend chocolate
Local time
Tomorrow, 05:31
Joined
Mar 10, 2008
Messages
1,746
Hi Rachael,

I've got a vineyard here in Oz and we're right in the middle of harvest so have been picking grapes for the last week.

yes, i gathered that by the sample db you sent. i LOVE good wine. SA has some really nice ones (i think that's where yours are?) my partner and i recently holidayed in NZ and we went on the wine-tours-by-bike. they've some fabulous wines over there. the gewurtstraminer was a particular stand-out for one of the vineyards, which, i'll have to revisit our itinerary to remember what the name of the vineyard was.

what sort of wines do you produce? i couldn't really tell from the DB...

(sorry to go off topic)....
 

Rachael

Registered User.
Local time
Today, 20:31
Joined
Nov 2, 2000
Messages
205
Hi Wiklendt,

I'm in North East Victoria in the King Valley, my grapes go into Holly's Garden Pinot Gris, Holly's Graden Pinot Noir and Holly's Garden Ramato (Pinot blend). Wine by bike in NZ sounds like fun, atleast you would have to worry about doing your license for .05! Although the bikes mightn't steer very straight by the end of the day!

Hi Bob, Thank you so much for your help on this, I really appreciate it.

Kind regards,

Rachael
 

wiklendt

i recommend chocolate
Local time
Tomorrow, 05:31
Joined
Mar 10, 2008
Messages
1,746
mmm.... 'seresin estate' in NZ had some pretty fabulous pinot gris (and noir, but i liked the gris better)
 

boblarson

Smeghead
Local time
Today, 12:31
Joined
Jan 12, 2001
Messages
32,059
Okay, hopefully this code will get you started on your way. This will give you a view of the SQL string and if you use the QueryDef object you can modify the query and pass it back to the Report.

Code:
Private Sub Report_Load()
Dim strSQL As String
Dim qryDef As QueryDef
Dim strS As String
    strS = Me.RecordSource
       Set qryDef = CurrentDb.QueryDefs(strS)
         strSQL = qryDef.SQL
      Debug.Print strSQL
End Sub
 

Rachael

Registered User.
Local time
Today, 20:31
Joined
Nov 2, 2000
Messages
205
Thanks heaps Bob will give it a crack!

Rachael
 

Users who are viewing this thread

Top Bottom