Results 1 to 10 of 10

Thread: Printing a Record from Access

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 1999
    Posts
    41
    I am developing a application in MS Access....In that there is a form which shows one record at a time, the fields being shown in different Text boxes.I want to add print functionality so that it prints the desired record...I tried using the following code...But I keep on getting message "Cannot create ActiveX object"...
    Doyou have any ideas...

    Dim prntObj As New VB.Global
    prntObj.Printer.NewPage

    thanks
    neelesh

  2. #2
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542
    What Version of Access are you using? 2000 brings up the Button wizard when you place a button on it then select the Print command.


    Spud

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 1999
    Posts
    41
    Access97

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 1999
    Posts
    41
    The problem is if I use the code generated by wizard, it only prints whatever is visible in the client window..I want to print the contents of each & every field (which corresponds to record)


  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Just make a report that prints what you want and have the button trigger the report. You can pass variables to the report and filter it so it only shows one record. Email me for details.

  6. #6
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542
    Dont know if this will help but I ran a macro and converted it to code and got the following to print all:On Error GoTo

    Command6_Enter_Err

    DoCmd.PrintOut acPrintAll, , , acHigh, 1, True


    Command6_Enter_Exit:
    Exit Sub

    Command6_Enter_Err:
    MsgBox Error$
    Resume Command6_Enter_Exit


    Hope it helps
    Spud


  7. #7

    Thread Starter
    Member
    Join Date
    Dec 1999
    Posts
    41
    Hello Edneeis
    I just finished creating a Report...It looks great...Now if you could tell me how to filter records I will really appreciate....I just need to print the current record...Also how to trigger that from the Button?

    thanks
    neelesh

  8. #8

    Thread Starter
    Member
    Join Date
    Dec 1999
    Posts
    41
    spud,
    I need to print only the selected record...Also I need to display everything even though its not visible on the form..

    thanks
    neelesh

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Sorry for the long wait to reply, assuming rs is your recordset or whatever holds it:
    Code:
    rs.Filter="RecordID=" & PassedID
    Then you pass the current record ID or any field that is unique and use it as PassedID.

  10. #10

    Thread Starter
    Member
    Join Date
    Dec 1999
    Posts
    41
    Thanks for ur reply!
    I think I did something like that(can't remember now)...
    But I do appreciate u getting bak 2 me...
    thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width