Results 1 to 4 of 4
  1. #1
    usmanghani_2654 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5

    How to print the hidden form using the visible form only - MS Access 1 Table and 2 Forms

    Hello All,
    I have a Lost/Found property database which we use to keep record of the lost/found property and it is working fine.
    As per our organization's policy, we keep the item(s) for up to three months in which if it gets restored to the owner then fair enough otherwise after three months the item(s) can be claimed by the "Finder". But for this very purpose we issue the Finder with a "Claim Receipt" which he/she should bring in when claiming for the item(s) after three months period. Therefore, It's just the right time to upgrade the database to a more professional level.

    Right.
    The database has one table and two forms.
    One form (LostFoundForm) is visible to the user in which they enter data, this form has two sections; Item(s) & Finder's details and the second section is about Restoring details.
    However the second form (ClaimReceiptForm) is hidden to the users (for manual data entry) and has only one section which is exactly the same as the first form's first section, i.e., Item(s) & Finder's details. This second form takes the data automatically from the first form because the table behind them is same and fields are same (please see attachment). Up to here it's all working fine.

    I would like to introduce a Checkbox or a CommandButton in the LostFoundForm which when we click should pull up a msgbox asking "Do you want to print the receipt for this item(s)?" with a Yes/No option. On clicking "No" it should, obviously, settle down but on clicking "Yes" it should print the "corresponding record" from the ClaimReceiptForm.

    So here's the million dollar question, "How can I do this?"



    Any relevant help would be much appreciated,

    Regards.

    Usman
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Build a report for printing receipt record.

    Then code can be like:

    DoCmd.RunCommand acCmdSaveRecord
    If MsgBox("Do you want to print receipt for this item?", vbYesNo) = vbYes Then
    DoCmd.OpenReport "Receipt", , , "ID=" & Me.ID
    End If

    This will generate a report for the current record of the form.

    The default open for a report is direct to default printer.
    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
    usmanghani_2654 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5
    Thank you for your reply June7, but what's the "ID=" & Me.ID here?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    That is filter criteria example. ID would be unique record identifier (primary key) and Me.ID is reference to that field/control on the 'visible' form - use actual names from your db.

    Reports are intended for printing and forms are intended for screen view. Each can be forced to do the other but not always with best results.
    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. Replies: 4
    Last Post: 11-04-2014, 07:35 PM
  2. Replies: 1
    Last Post: 09-03-2014, 01:36 PM
  3. Field Data not visible / hidden
    By Xarkath in forum Access
    Replies: 3
    Last Post: 08-22-2014, 07:14 PM
  4. Replies: 1
    Last Post: 03-20-2013, 07:04 AM
  5. Replies: 2
    Last Post: 04-04-2011, 02:18 PM

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