Search results

  1. M

    Pass form name to function

    @jdraw I set the recordset to a clone of the forms recordset, that should suffice. I don't know what went wrong with your test, rem the on err line and see what happens. @mdlueck AND boblarson As VbaInet pointed out, I am after the count of selected records not the recordcount. @VbaInet I...
  2. M

    Pass form name to function

    I'm using the following function to count the number of selected records in a datasheet or continuous form view. Function CountSelectedRecords() Dim i As Integer Dim F As Form Dim RS As Recordset Dim intSelRec As Integer On Error GoTo Err_Catch ' Get the form and its...
  3. M

    Too few parameters error with date range

    Never mind I got it, I passed the forms!ect. as a string.
  4. M

    Too few parameters error with date range

    Yes I checked that the controls are returning the proper values using "?" when the code broke. If the date filter part is 'inside' or 'outside' the strSQL I get the Too few parameters error, and if the filter is 'outside' of the strSQL and I rem out the datefilter line I get a 3075 runtime...
  5. M

    Too few parameters error with date range

    Ok, following you're advice I finally managed to get the SQL to return the expected records. SELECT DISTINCT tblBuyers.ID, tblBuyers.Email, Nz([tblBuyers].[FirstName],"") & " " & Nz([tblBuyers].[Surname],"") AS Name, Max(tblApartments.DateUpdated) AS MaxOfDateUpdated FROM tblApartments...
  6. M

    Too few parameters error with date range

    That's how I started, but when I try this I get an error: You tried to execute a query that does not include the specified expression 'ID' as part of an aggregate function. SELECT DISTINCT tblBuyers.ID, tblBuyers.Email, Nz([tblBuyers].[FirstName],"") & " " & Nz([tblBuyers].[Surname],"") AS...
  7. M

    Too few parameters error with date range

    That's what I'm trying to do, but I can't figure out how to use Max() with my strSQL.
  8. M

    Too few parameters error with date range

    You're right about using the report record source (of course!). The problem is that DateUpdated is in a different table than the rest of the info, and it has more than one value per contact.
  9. M

    Too few parameters error with date range

    The recordset is returning the contacts as expected. The problem is that it returns each contact more than once. This is my latest attempt: Private Sub cmdEmail_Click() Dim rs As DAO.Recordset Dim strSQL As String Dim rpt As Report DoCmd.OpenReport "rptRealGrouped"...
  10. M

    Group Running Sum in Textbox

    Thank you is a small word for saying what I need to say... But I'll say it anyway THANK YOU!!!
  11. M

    Too few parameters error with date range

    I thought that that's what I did with the above rs. Temp is an alias for a query.
  12. M

    Too few parameters error with date range

    Here you go: Private Sub cmdEmail_Click() Dim rs As DAO.Recordset Dim strSQL As String Dim rpt As Report Dim strFile As String Dim strPath As String Dim strReport As String Dim strFullPath As String DoCmd.OpenReport "rptRealGrouped", acViewPreview, , ...
  13. M

    Group Running Sum in Textbox

    Using only your code in the report this what I get: On the first and second pages of the first group the page header is visible. On the third page it isn't visible. On the second page of all other groups, the page header isn't visible. What I need is: in all groups, the page header will not be...
  14. M

    Too few parameters error with date range

    Ok, I got the SQL string right the problem was it was missing a ampersand between "And ([Temp].[Name])<>"")" and "[Temp].[DateUpdated]". Back to the second issue. I want one report per contact, filtering the records so only records that have DateUpdated between the dates entered on the form...
  15. M

    Group Running Sum in Textbox

    The first page of each group should contain only the group header, if I use the "[Page] of [Pages]" to determine when the page header is displayed, the second group and on will have the page header on their first page (instead of only the group header). This is the code I tried: Private Sub...
  16. M

    Group Running Sum in Textbox

    The "[Page] of [Pages]" textbox is overall for all groups, I use a different method to determine the page per group (you'll see it in the report), but using that doesn't work either.
  17. M

    Too few parameters error with date range

    1. I don't see how the form reference is 'outside' the SQL statement, the reference is concatenated to the strSQL. When I tried it I got a 3075 runtime error: Syntax error (missing operator) in query expression: WHERE (([Temp].[Email]) Is Not Null And ([Temp].[Email])<>"") AND (([Temp].[Name])...
  18. M

    Group Running Sum in Textbox

    No matter what I try either the page header is visible on all pages, or isn't visible on the first two pages.
  19. M

    Too few parameters error with date range

    Using the sql in a query filters fine, running it in code doesn't filter, a problem I have in both cases is, it will loop for the number of different DateUpdated values per contact instead of once per contact.
  20. M

    Group Running Sum in Textbox

    Yes it does, the only problem is with the second page of each group (the group header spans over a whole page).
Back
Top Bottom