Hi CCLINT,
This definitely works for that one payment code. Thanks! That's unqualified.
SELECT [StudentDataTest].[Folio], [Receipts].[ Code], SUM([Receipts].[Amount]) AS Total
FROM [StudentDataTest] INNER JOIN [Receipts] ON [StudentDataTest].[Folio]=[Receipts].[Folio]
WHERE [Receipts].[ Code]...
Thanks Trendsetter,
I'm sorry if I miscommunicated my request.
What I was hoping to get was a way to get the rows I want with the SQL alone.
I want to only see those Sum(Receipts.Amount)
which are less than 320
if the Receipts.Code Like("TUI%")
When I open my recordset with the...
Sorry - For some reason the last line of my query showed up with an error - here it is again without that weird last character - " [Code] " - which I get when I try & enter the word 'Code' with square brackets [] around it.
SELECT [StudentDataTest].[FOLIO], [Receipts].[ Code]...
MS Access 2000.
I have this Query:
SELECT [StudentDataTest].[FOLIO], [Receipts].[ Code], SUM([Receipts.Amount]) AS Total
FROM StudentDataTest INNER JOIN Receipts ON [StudentDataTest].[FOLIO]=[Receipts].[Folio]
GROUP BY [StudentDataTest].[FOLIO], [Receipts].[Code];
Folio: is a Student's Unique...
I agree - I just felt uncomfortable putting the code up repeatedly. Once it is figured out the working structure can be posted.
Please email me - so I'll have an email address for you.
Thanks,
Robeen
Hi CCLINT.
I'm going to work on this a little more.
May I email you after I've made some progress - maybe next week or later? If so - please email me at rsengupta@lifetouch.com. I don't know about pasting long code here . . .
Robeen
Hi CCLINT,
I took your suggestion about re-writing my select statement to get all my totals in the first recordset.
Here's what it looks like:
SELECT StudentDataTest.FOLIO, Receipts.Code, SUM([Receipts.Amount]) AS SubTotal
FROM StudentDataTest INNER JOIN Receipts ON StudentDataTest.FOLIO =...
Thanks CCLINT!
You know - it's been working again.
I commented these two lines out:
'Set rstFolio = Nothing
'Set rstCode = Nothing
Trouble is - now I'm not closing these recordsets at all. I'm trying to find out what the consequences are of leaving the recordsets open like that.
I do have a...
Thanks ddc821!
Are you recommending that I do not have two active recordsets going at the same time and instead get all my unique IDs into an array variable before opening the second recordset?
If so, I had considered that - and I might end up doing that eventually - the thing is I like the...
vb 6.0 - MSAccess 2000.
I'm using two recordsets as follows:
rst1 - to Get all the [unique] IDs from a Master Table - using an SQL statement as the DataSource.
Then I'm Looping through the IDs one at a time & for each ID
I'm opening a 2nd Recordset with a different SQL statement as its...
Thanks CCLINT,
I am still getting this message:
"Run-Time Error 3704
Operation is not allowed when the object is closed."
as soon as I try & do a Move First on the second Recordset -"rstCode.MoveFirst".
The odd thing is that I was able to run this successfully before making...
Actually -
This:
'Set cnn = Nothing
Is Active:
Set cnn = Nothing
Sorry - I tried commenting it out to see if the fact that the conection was 'Nothinged' was what was causing the '3074'.
Robin
Hi CClint!
Here's the ExecuteSQL Module:
Public Function ExecuteSQL(ByVal SQL _
As String, MsgString As String) _
As ADODB.Recordset
'Executes SQL and returns Recordset & SQL Message.
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim sTokens() As String...
Hi!
VB 6.0 - MS Access 2000.
I'm trying to use two recordsets simultaneously as follows:
Set rstFolio = New ADODB.Recordset
Set rstCode = New ADODB.Recordset
strSQLText = "Select [Folio] from [StudentDataTest] order by [Folio]"
Set rstFolio.DataSource = ExecuteSQL(strSQLText...
Thanks guys!
I come from a PowerBuilder background where you can declare
like that . . . how silly of me to expect it to be similar in VB . . .
If something's that easy - would it be a Microsoft product??
:) [oooooof!!! where did that come from???]
I've made the changes & everything's fine...
...is the Function Declaration: in a Bas Module.
Public Function ExecuteSQL(ByVal SQL _
As String, MsgString As String) _
As ADODB.Recordset
*******
When I try & run with a full compile I get:
"ByRef argument Type Mismatch"
& it highlights "strMsgText"
in...
In VB 6.0 - how do I set up Global Variables?
For instance - if I need a UserID to be stored throughout the session - after a user has logged in - where can I declare the Variable so that once the User has logged in I can check who the user is at any given point in the Application & decide if...
Thank you so much, guys!
I'll give your suggestoins a try next week!
I appreciate your help. I could have looked for a long time in the Help Files and not found the answer.
I sometimes wonder if I'm alone in feeling that the Microsoft VB Help Files are often difficult to extract help from.
Of...
I want to write a 'Clear All' function that can be called from anywhere in my application that will Loop through all the controls on the Form from which the function is called, identify which ones are [for instance] TextBoxes, ListBoxes & ComboBoxes and then clear their contents - setting them...
Thanks jtran34!
I wrote a function that is available to every Form -
That validates for Text Only -
With a For Next Loop based on the length of the string - That checks that the ASCII value of each character is in 65-90 or 97-122 -
And returns the offending character [if any] to the calling...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.