Results 1 to 4 of 4
  1. #1
    clrockwell15 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2017
    Posts
    23

    Making a button with a macro work


    I have a database with multiple contacts. I have forms built to maintain those contacts. One of those forms is for inputting data for a new contact. I have built a button to run a macro to "PrintPreview" a report (happens to be a welcome letter to the new contact. What I'd like for this button to do is to print preview the welcome letter but have the contact information (e.g., name, address, city, zip) on the report that I "printpreview". is there a way?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    Bind the report to table or query and then bind textboxes to fields. This is basic Access functionality. What exactly is the issue?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    clrockwell15 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2017
    Posts
    23
    Sorry. Didn't make myself very clear. When I input the data for that person on my "New Contact" form screen, I want to be able to click the "Welcome Letter" button and pick up the "Name, Address, City, St, and Zip" from this open record and insert them into my report. I know about binding. I can do that. Just trying to get the data from the on screen form to the report.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    So the new contact record must first be committed to table. Record is committed when 1. close table/query/form or 2. move to another record row or 3. run code to save. Then apply filter criteria when opening report. I don't use macros, only VBA. Something like:

    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenReport "report name", , , "ContactID = " & Me!ContactID
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Making Last Record Appear in Macro Button
    By wes9659 in forum Access
    Replies: 2
    Last Post: 04-14-2014, 01:34 PM
  2. Need Help/Idea with making query work
    By SilentReyn in forum Queries
    Replies: 9
    Last Post: 03-06-2013, 02:49 PM
  3. Replies: 0
    Last Post: 06-29-2010, 12:04 PM
  4. Replies: 3
    Last Post: 10-16-2009, 07:54 AM
  5. Making the like operator work for fields
    By olidav911 in forum Queries
    Replies: 2
    Last Post: 06-06-2009, 01:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums