Printing Image Contact Form
Jun 9, 2007
I created a print image form in my project so that when a user opens the form, it cycles through all the images stored in a temp folder and prints them out four images/page at a time until all the images have been cycled through. I am using the below code on the "OnCurrent" event of the form. The problem I am having is trying to close the form with code after the images have been cycled through. I get an error message stating that "this action can't be carried out while processing a form or report event" I guess it is caused by the form still being sent to print. How do I add a code to catch the event when the form has finished printing? Also, when I open the form by itself, it works correctly and prints all of the images. However, when I tried to use a switchboard to open the form, it prints the switchboard form. Please help me in correcting this. Thanks
Private Sub Form_Current()
Dim mysql As String
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim PicPath As String
Dim TotalSet As Integer
Dim CurSet As Integer
Dim SetStart As Integer
Dim RecNo As Integer
Dim PicNo As Integer
Dim RecCount As Integer
Dim RecNoMove As String
Dim PageCount As String
Set rs = New ADODB.Recordset
Set conn = CurrentProject.Connection
mysql = "SELECT tbl_Image.*, tbl_Image.SelectPrint " & _
"FROM tbl_Image " & _
"WHERE (((tbl_Image.SelectPrint)=Yes));"
rs.Open mysql, conn, adOpenKeyset, adLockOptimistic
RecCount = rs.recordCount
TotalSet = (Int(((RecCount) / 5)) + 1)
CurSet = 1
PicNo = 1
SetStart = (((CurSet) * 4) - 4) + 1
rs.MoveFirst
NextSet:
For RecNo = 1 To 4
PicPath = rs("myimagepath")
Me("image" & PicNo).Picture = PicPath
PicNo = PicNo + 1
rs.MoveNext
If rs.EOF Then
If Me.Image1.Picture = "(none)" Then
End
Else
PageCount = "Page " & CurSet & " of " & TotalSet
Me.PageCount_txt = PageCount
DoCmd.PrintOut acPrintAll
GoTo closepage
End If
End
Else
End If
Next RecNo
PageCount = "Page " & CurSet & " of " & TotalSet
Me.PageCount_txt = PageCount
DoCmd.PrintOut acPrintAll
PicNo = 1
CurSet = CurSet + 1
Me.Image1.Picture = "(none)"
Me.Image2.Picture = "(none)"
Me.Image3.Picture = "(none)"
Me.Image4.Picture = "(none)"
GoTo NextSet
End
closepage:
DoCmd.Close acForm, "frm_printimage_4", acSaveNo
End Sub
View Replies
ADVERTISEMENT
Dec 3, 2004
MS Access 2003
I inserted an image (jpg) in a report, it appears in PrintPreview, but not when I print it on my printer.
Please help me. I do not if the problem is with my printer or I'm doing something wrong when inserting the image.
update: It seems to work when printing from Print icon, but does not work when printing from File/Print menu. Is this a known bug?
View 5 Replies
View Related
Oct 22, 2013
I am trying to have a macro button so when I click it it Emails to a particular person but also prints off a copy.it all works fine but for some reason it wont print the image off, my macro is as below
RunCommand - Print
SendObject - Report, RPTDailyReports
Close - Report, RPTDailyReport
when I do CTRL + P and put the print quality up to 'Super' it prints fine
View 4 Replies
View Related
Jul 24, 2013
I need to be able to browse to and open a folder from a form, and import images from within that folder to (i guess?) another form?
I then need to print each image on 3 different reports, but in order as below...
Image 1 - report 1
Image 1 - report 2
Image 1 - report 3
Image 2 - report 1
Image 2 - report 2
Image 2 - report 3
etc
Once images / reports are printed they can be removed.
Should I have a page that shows maybe 40 images and a big print button? or 40 images with a selection box by each one and a big print button? or 40 images and 40 print buttons? etc
The reports will need to change in the future, so a option to select any or all of the reports would be a really good idea.
I have access 2013 but I much prefer 2003 as I know where all the buttons are!
View 1 Replies
View Related
Apr 20, 2015
I am running Access 2013. I have created a report where the tables are linked to a SQL DB
I am trying to run a sales report that includes an stored image.
I am adding an Image and then using the control source to look up the 'filepath' stored in the DB. When I run the report on screen all the images are showing but when I try to print it (including exporting to PDF or XPS) and Print Preview only 2 of the 9 images print per page. The images are around 2-4 Mb.
I'm guessing its to do with the files sizes but cannot do anything about the size.
View 1 Replies
View Related
Jun 16, 2006
Hi guys,
I'm in desperate need of help and want to know if it is possible to load an image on a form once a hyper link is created.
For example, I have a form with a hyper link to an image created, currently, when you click on the hyperlink, it opens the picture in the browser, can you change it so that it loads teh image embedded into the form instead of loading it into a browser?
If so, how?
Thanks
View 1 Replies
View Related
Jul 28, 2006
Hi I have a Contact form with all the details of the contacts, I would like to add a photo for each contact, how can I get to this?
Marco
View 1 Replies
View Related
Nov 3, 2004
I've researched all the email topics, but can't find what I am trying to do.
Most of these topics are talking about emailing a record or form or something.
I have a form that contains thousands of contacts address, telephone, email, etc.
I would like to create a button that on click would open Outlook and grab ONLY the
email of the current contact I am looking at on the form at that time and add that
email address to the [To:] box of a new email.
Thanks you guys, I'm learning...slowly, but it's coming.
View 4 Replies
View Related
Jul 19, 2013
I am using Access 2010 and I want to be able to open a blank email addressed to the contact I am viewing in my Access form. I have been successful in creating a button which opens Outlook, but I don't know what code to put in the 'To' field of the EmailDatabaseObject page so that it picks up the email address of the contact I am looking at.
View 2 Replies
View Related
Jan 8, 2014
Microsoft has a Desktop Student Database template (Access 2010) that does exactly what I'm trying to do:
open the Outlook Contacts dialog box, select a contact from the GAL, and then programmatically save it to a record in one of my tables.
I've tried simulating the button/coding on my data entry form, but I'm getting the error:
"The command or action 'AddFromOutlook' isn't available now"
I've search high and low but have only found a reference to creating a temp contacts table to import all the contacts.
View 2 Replies
View Related
Sep 18, 2014
I have a list of people in a list box. In the list box I only have the people names listed. (example below)
1. John
2. Frank
3. Tim
4. Jessica
I want to click on one of the names and have a form pop up on the same screen that lists the persons contact info. If I had a table like listed below, could the info auto populate on a separate form.
[ID] [Name] [Number] [Address]
1. John 456-4567 123 Elm Rd.
2.
I want the Form to pop up and show...
Name: John
Number: 456-4567
Address: 123 Elm Rd.
View 1 Replies
View Related
Dec 4, 2014
I have a form that I would like to update a picture on using VBA. The source of the picture path is in part a query that is not bound to the form. So far I have the following code that is pretty much working, but with a couple flaws.
Code:
Private Sub Form_Current()
LoadDefaultPicture
End Sub
Sub LoadDefaultPicture()
Dim db As DAO.Database
[Code] ....
This is working. However, when I change the record the picture flashes the current picture once and then loads the new picture. It is like it reloads the current picture then loads the new one. I'm hoping there is a way to get rid of the flash.
Also, the code fails here:
strDefaultPictureName = rs.Fields("AttachmentName")
When the query does not return a record. I can definitely fix this by adding an if statement to check for a record, but I'm kind of perplexed at why it is failing at that line. I would expect it to assign an empty string to that variable name and then fail on the next command where I try and set the ".Picture" property of the image.
View 8 Replies
View Related
Feb 6, 2005
Hi all ,
Can anyone tell me about how to embedd image in image control using imagelist.
I added the 5 images in imagelist at design time and added the following code.
image.picture=imagelist.listimages(1).picture
but iam getting error.error no :2110,cannot open the file .
thank u,
Siva
View 3 Replies
View Related
Feb 25, 2014
I was having trouble just setting each report with a particular print method - for some reason they just kept forgetting their individual settings and resorting to default on the machine.
This meant reports were printing on the wrong paper, or the wrong size paper, the wrong orientation and some times refusing to print if it couldn't find the paper (which is useful in runtime as it doesn't display error messages)
So I used Reports(rpt).printer properties (I forgot where I found this) to hard code the printer properties into each print command... this meant I had to use another function to insert the variables.
So all I had to do was say:
Code:
PrintMe("Invoice","InvoiceID",iID)
and a report would print to exactly how I wanted... but it's just too slow!
See attached for full code, I have a niggling feeling it may be the function: PrinterOK, to make sure the printer exists or not.
Code:
Function PrinterOK(sPrinterName As String) As Boolean
Dim MyPrinter As Printer
PrinterOK = False
For Each MyPrinter In Printers
If MyPrinter.DeviceName = sPrinterName Then
PrinterOK = True
Exit Function
End If
Next
End Function
I know it's the printing code, because if I stop the printing and just preview then it shows up almost instantly.
View 1 Replies
View Related
Jun 5, 2007
I Have Some Images I Am Using That Are Bound As Ole Objects In A Table. When I Got View The Images On The Form They Come Up As Icons Even Though I Have Them Set To Content. I Also Noticed That In The Table Column It Notes Them As A Package Versus A Bitmap File. I Am Not Sure Why. Anybody Run Into This Problem?
View 13 Replies
View Related
Feb 10, 2014
I have been tasked to scan family pictures in such a way so they are available to older family members to identify people younger family members dont know. My solution is to scan each photo, name them 1.jpg, 2.jpg. about 4000 images. Store them in a directory (H:Family). I then want to create a form that will use the PK which is an auto number to pull that numbered picture into the form where someone can enter the other fields. I have fun with Access but this is well above my knowledge level!!
View 7 Replies
View Related
Jun 9, 2005
I have a form which uses a query for entry to the table. One of the fields in the query is a calculated field which shows in the form. The calculated field returns a number from 1 to 5. Rather than showing this number I would like to show a round stoplight that changes color for each number. I have inserted a OLE object OLEunbound235 into the form. The colors I want to use are
icolor = RGB(255, 204, 0) 'Gold
icolor = RGB(192, 192, 192) 'Silver
icolor = RGB(216, 129, 0) 'Bronze
icolor = RGB(255, 255, 0) 'Yellow
icolor = RGB(255, 0, 0) 'Red
and icolor = RGB(255, 255, 255) 'White for any other value.
The text box that returns the calculated number is labeled Text1 and I have hidden this box so it can not be seen. Does anyone know how to write this code that would change the OLE object color automatically so when the user enters data into the form and the return number changes the color of the OLE object changes. I know very little about VBA and I am not sure where to begin or where to even write the code.
:confused:
View 2 Replies
View Related
Sep 25, 2005
Wonder if you guys can help, I have searched the forums, but can't find an exact match to my query...
... i want my users to see a coloured image on their form to alert them to the status of a record in the database.
I have 3 very small bitmap images (named red, amber and green and stored directly next to my database ). I want to allow users to change which image should display on any given record by choosing either from a combo-box or radio buttons located next to the 'image space' on the same form. This image change will then save when the database is closed and remain until it is changed to another staus by a subsequent user at a later date.
Any ideas greatly appreciated (I'm currently at [I]'dimwit' level with coding)
Id
View 3 Replies
View Related
Feb 21, 2006
Hi all,
Right trying to create a database that is centered around displaying images.
I already have my forms and navigation working fine but need some help with the images. what i would like, if possible, is on the forms one image is displayed but it has navigation buttons underneath to switch between images in the form. nothing fancy just that!
if anyone has done this before or has any ideas it would be greatly appreciated!!
cheers
chris
View 2 Replies
View Related
Sep 21, 2006
No? Yes? If, so how?
View 2 Replies
View Related
Nov 23, 2005
I have a form in which I want to retrieve images from a folder. Each record contains a txt field where the path of the image is located. Not every record contains a path to the image file as some records does not have images. I have created an image field in my form and used the following code: Me.Image129.Picture = Me.imagetxt to retrieve the image. I would like to display an image containing the words "No Image" whenever the imagetxt field is blank. How would I do this. I cannot go back and fill in the blank imagetxt field with a path as I am pulling the data from an external source. Also, would this be the same method if I am creating an image field for a report? Any help would be greatly appreciated.
View 2 Replies
View Related
Jun 18, 2013
How do i actually store and display my image in a form which works when i click on a item in the listbox and it will display the image i want.Currently i'm using a unbound form with listbox and rowsource from Queries.When i click on the listbox it gave me
"you referred to a property by a numeric argument that's isn't one of the property numbers in this collection."
This is the code i tested
Quote:
Private Sub List6_Click()
If Me.List6.ItemsSelected.Item(3) = "DF" Then
Me.Image32.Visible = True
End If
End Sub
the (3) is referred to the 3rd column of the listbox right? is it because the rowsource is from a query that's why i have that error or because the query contains multiple different tables?
is there any simple way to insert image into access and it will appear in just 1 image box ? and depending on which item i click on the listbox the image will change?
View 8 Replies
View Related
Apr 12, 2006
i have a search form with a sub form displaying the results, how can i send the results to a report to print out or just print the results?:confused:
View 5 Replies
View Related
Apr 26, 2006
I have a form with multiple subforms. When I hit print selected record I get a blank sheet of paper. What could be set to not allow the data or the background of the form to print?
If I just print the subform out by itsself it works good. However when I have the main form open then try to print I get blank pages.
I am sure someone changed a fairly small setting, but I do not know what has been changed. Thanks.
View 1 Replies
View Related
Aug 9, 2006
:eek: When I go to print the form, it repeats the detail section over and over. Instead of being one page, it is 1414. How can I fix this problem? Thanks
View 4 Replies
View Related
Nov 7, 2006
lets say i have a data field which contains hyperlink for a html file, can i display the content of the file from the hyperlink in the form when the form is loaded?
View 1 Replies
View Related