Search results

  1. L

    reading sequence through a recordset

    I am using the following code to read a series of records from a table and use the names included in each record to print a form. Private Sub Command0_Click() Dim rst As DAO.Recordset Dim printout As Integer printout = 0 Const MemberQuery As String = "SELECT StudentName FROM...
  2. L

    Printing from VBA

    I think it was a carryover. Plus, I didn't realize that the print command would be implicit. In any case, that solved the problem! Thank you so much!
  3. L

    Printing from VBA

    when the error message popped up I selected "debug" which took me to the code. The line that was highlighted was Reports.("Enrolled Students Letter").Print.
  4. L

    Printing from VBA

    The error message reads: Run-time error '2451'. The report named 'Enrolled Students Letter' you entered is misspelled or refers to a report that isn't open or doesn't exist.
  5. L

    Printing from VBA

    Thanks for the revised code. I see some commands in there that I will need to learn for future use. I've run the code and it does solve the problem of printing the form in addition to the report. There's a problem, though. I've stepped through the code to track it, and here's what happens: it...
  6. L

    Printing from VBA

    Apologies. I misunderstood your earlier request. Here's the code. I still get the same error message. Here's the code: Private Sub Command0_Click() ' Error handler On Error GoTo 0 ' Create a SELECT command Dim MemberQuery MemberQuery = "SELECT MemberData_Test.StudentID...
  7. L

    Printing from VBA

    thanks for the quick reply. I inserted the statement DoCmd.SelectObject acReport, "Enrolled Students Letter" after the statement DoCmd.OpenReport "Enrolled Students Letter" and before the statement DoCmd.RunCommand acCmdPrint, but now the code stops executing at that new statement and produces...
  8. L

    Printing from VBA

    I have a small but annoying problem that I'm hoping someone can help me with. I've attached a file containing some code that's activated when the user clicks on a button on a form called DistributeLetters. The code is supposed to get some information from a table and use it to fill in a report...
  9. L

    Suppressing Duplicates

    Beautiful! I really like your last SQL statement; it does all that I needed to do for the mailing labels. I added DISTINCT to the SELECT statement and got rid of all the duplicates. Thank you so much!!
  10. L

    Suppressing Duplicates

    Oh, sorry. I did try DISTINCT. I put it at the beginning of the SQL statement as in "SELECT DISTINCT" rather than just "SELECT". It eliminated one name, but left a number of duplicates.
  11. L

    Suppressing Duplicates

    Ok, I've attached the query and the two tables it draws data from. The query first looks at the enrollment table to find the names of the members enrolled (have expressed a preference number for a course) but do not have an email address, then obtains the address information from the member data...
  12. L

    Suppressing Duplicates

    I agree that that's the way to do it, but I'm unsure of the SQL syntax. There are a number of fields that have to be reported in addition to the member names. Can I restrict the DISTINCT instruction to just one or two fields?
  13. L

    Suppressing Duplicates

    I have a table listing organization members and the various trips they have signed up for and would like to make mailing labels based on that list. The problem is that any one member may have signed up for multiple trips, yet I'd only need one mailing label for that member. So a simple query...
  14. L

    Question Disabling startup with shift key

    Eureka! That was it. I checked the "Allow Full Menus" box and now the database opens without the shift key. Thank you so much!! It's been a minor but longstanding annoyance, now solved. Leathem
  15. L

    Question Disabling startup with shift key

    Sorry for the delay in responding. My Access version is 2010, and I've tried going through Files/Options/current database and changing settings, because that's where I think that the original change was made, but to no avail. If that's the place for the change, which option is it that is causing...
  16. L

    Question Disabling startup with shift key

    This is no doubt a dumb question, but when I first was learning Access a few weeks ago I followed a procedure which now forces me to use the SHIFT key every time I open the database or I can only have access to a restricted set of commands. I can't for the life of me remember what I set to...
  17. L

    Report as a letter

    eureka! That did it! Your suggestion about the property sheet for the StudentID footer bar worked (oh, and yes, I took your suggestion about changing the grouping to the ID number rather than the name; you were quite correct.). Thank you so much!
  18. L

    Report as a letter

    I see how to make the footer invisible in the Properties section, but I can't find any option for starting a new page. I'm also not sure what you mean by the "Group footer". In design view I see the sections Report Header, Page Header, StudentName Header, Detail, StudentName Footer, Page Footer...
  19. L

    Report as a letter

    I'm not sure I follow you. I found on the Properties for the report a line for "Grp Keep Together", which I changed to "Per Page", but it didn't solve the problem. I also went into the "Group, Sort and Total" section of the Design view of the report and under the grouping options chose group on...
  20. L

    Report as a letter

    I could do that, but it doesn't help with the formatting problem. The duplication of names doesn't arise here though, since the "name" field is a concatination of first and last names. Individual first and last name fields are used for other purposes.
Back
Top Bottom