Modules & VBA :: Identify Image Control Name?

Nov 8, 2013

I have a global function which I have hooked onto the onClick event of controls. Currently I am using commandButtons as my control of choice. In my function I can then reference Forms.ActiveControl which is no problem.

However, for lots of reasons I really need to use Image controls. Now, my problem. Image Controls have an Onclick Event, but they do not get focus so the Forms.ActiveControl will not work.

How can I identify the image control that has generated the click event if the control itself does not get focus and so cannot be referenced by ActiveControl? Working on a possibly work around, but could do with the best brains in Access on the case!

View Replies


ADVERTISEMENT

How To Embedd Image In Image Control Using Imagelist.

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

Modules & VBA :: Changing Image Path - Set Picture Property Of Image

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

Forms :: Subform Control Event - Identify Parent And Child Forms

Jun 20, 2013

I have a listbox on a subform (or a subform within a subform).

When it is clicked I want all other listboxes to unselect.

There may be listboxes on the mainform, on other subforms, on other subforms of subforms.

I imagine I'm looking at a recursive function of some sort, but I'm not entirely sure of syntax to identify parent and children forms...

pseudocode so far:
loop all controls
if control = listbox, unselect all
if control = subform - recurse: loop all subform controls
if control = parent... err... Fail.

View 3 Replies View Related

Where Is Image Control On The Toolbox?

Dec 22, 2006

I am going crazy!!. I want to use .jpg images in my Access Form (Access 2003). All the tutorials and forums talk about using Image Control to display .jpg images. But I can't find the Image Control on the toolBox??? Where is the Image Control?? I am currently useing Unbound Image Control but that only allows me to display .bmp images.

Help!!!

View 2 Replies View Related

Modules & VBA :: Identify Users With Database Open

May 1, 2014

I'm wondering if there's any way to find out who has a database open.

I've saved the file as an ACCDE for the users and kept the ACCDB file as my working file. Whenever I make changes to the db I need to save a new ACCDE file on top of the existing one. In order to do that, I need to ensure no one has the db open. Half the time I need to track down 1 of 15 people to find out who it is that has it open so I can kick them out and save.

I don't have any login features, but could use the POD # that each cubicle has associated to their computer if Access allows that...

View 8 Replies View Related

Control To Browse For An Image File

Aug 18, 2005

Hi,

I'm trying to add a control to my form that I don't know how to do.


On my form, I want the user to be able to click a button which will open up the standard file open dialog box. The user then will be able to browse through the appropriate directory and select an image file which will be saved on that specific record.

Attached is a strip down database as an example.

How can I do this? Any help would be greatly appreciated - I'm trying to do this for my work.

View 6 Replies View Related

Modules & VBA :: DBA Code - Identify If 2 Fields Within A Table Have Been Populated

Sep 25, 2014

trying to identify if 2 fields within a table have been populated i.e.

Check date field and restaurant field, if these fields have been populated do

this

errStr = errStr & tmpDate & ", "
Else
validStr = validStr & tmpDate & ", "

[Code]...

View 14 Replies View Related

Third Party Control - Kodak Image Viewer

Apr 6, 2006

I have a database that was built by some users, long before I came to my current job location (oh yes, one of those fun issues), and have run into an error that is involving a 3rd party tool, and is tough to duplicate.

There is an ocx control named "Kodak Image Thumbnail control" the path is C:winntsystem32ImgThumb32.ocx.

This is an active x control, that on the double click event, opens up the correct corresponding .pdf file. It works correct for me, on my machine. It works correctly for 3 other people on their own machines. When we had a user it worked correctly log into a user who it does not work correctly, it then worked correctly for them (appears to be user rights, and not machine specific). It does not work correctly for another 2-4 users (not sure the exact number).

But, the rights were gone over with a fine tooth comb, and nothing was found different from each user.

What is weird, is how the error occurs. There are 59 records in the database, with a linking .pdf file displayed in this .ocx control. For those users in which this does not work, the first two records open the .pdf correctly. After this (records 3 to 59) they receive the following error:

"Microsoft Access can't open the file containing the OLE object.

- You may have specified an invalid file name or an invalid unit of data (such as a range of cells from a worksheet) when the file for the OLE object.
- The file you specified may not be available because it's locked by another user or you don't have permission to use it.

Try one of the following:
- Make sure the file is available and that you used the correct file name.
- Check the OLE server's documentation for information about the syntax to use when specifiying an OLE object's data."

[OK]

Since this is a third party tool, that I have never used, and do not even have on my machine (yet it works correctly for me) I am not sure what else I can do to track down the error. I just wanted to see if anyone else has run into this error, and if so how they had fixed it.

Thank you for your time.

T.J.

View 3 Replies View Related

How To Make Control To Browse For Image And Enter It Into The DB

Dec 24, 2006

I know everyone is going to say DONT PUT IMAGES IN YOUR DB< PUT LINKS TO THEM IN!

I am not at liberty to change the structure of what my boss wants, he wants the images stored in the DB so that is what I am giving him.

My problem is this: I have a single form for entering data into my Table, and I want to add a control that will let the User Browse for the right image, and them add that image chosen into the DB with maybe an upload button or something.

Now, if it is VERY VERY poor design to do it this way, and it is SOO much better to do the link to image way, if you could please detail how it works in both ways, I may be able to talk my boss into changing. My problem is I am not very good at this DB Designing and such, and have no experience using OLE type fields.

Thank you for ANY assistance you may give!

PS: All images will be same type and size!

View 1 Replies View Related

Forms :: Show Image Based On Another Control Value?

Nov 5, 2014

I have a text box [txtTrafficValue] that is a calculated field of two short times. I want an image to be visible if the value is >= 0.0104 (15 minutes). I have in the after update of the field:

if me.txtTrafficValue >= 0.0104 Then
Me.imgWarning.visible = true
Else
Me.imgWarning.visible = false
End if

but when the field does the calculation and updates the image is not appearing.

View 5 Replies View Related

Modules & VBA :: ListBox Identify Selected Item Without Looping In Whole List

May 9, 2014

Show me the selected item in a Listbox without looping in the whole list, because my Listbox is multiselect and I want only the item that selected recently.

View 8 Replies View Related

Cant Create Image Edit Control In Access Form

Oct 4, 2006

Hi,

I've searched a lot and couldn't find an answer to my problem.

I want to have a field in my form that allow me to paste an image from the clipboard to, for example, a Paint field. Then, I want to save that image to a file on a specific folder in my computer via VB.

The reason for this is that I don't want to ask the user to open paint by himself and save the file, probably in the wrong location and with the wrong name.

The first approach was creating an OLE Object directly from the Insert menu and that worked partially. It allowed me to paste the image but there wasn't a way to save it to a file, neither a method for that. It was an incrusted object, and I think that is the reason for that.

Then I tried to create the object by myself via VB, with the instructions:

Dim objeto_perfil As Object
Set objeto_perfil = CreateObject("Paint.Picture") 'IT STOPS HERE

And with the variation:

Dim objeto_perfil As Object
Set objeto_perfil = CreateObject("Paint") 'IT STOPS HERE

And neither worked. The error message says it lacks an object.

Then I followed an example from msdn that used a bound frame (view here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acproClass_HV05187062.asp)). The code is:


visor_perfil.Class = "Paint.Picture" ' Set class name.
' Specify type of object.
visor_perfil.OLETypeAllowed = acOLELinked
' Specify source file.
visor_perfil.SourceDoc = "C:RealPathimage.BMP"
' Create linked object.
visor_perfil.Action = acOLECreateLink 'IT STOPS HERE
' Adjust control size.
visor_perfil.SizeMode = acOLESizeZoom


It stops in the action assignation, an says "error 2753 there was an error trying to communicate with the OLE server".

I google a lot and could find much of the Paint.Picture Class.

Anyone has any ideas to overcome this issue? What am I doing wrong?

Thanks in advance!

View 3 Replies View Related

Forms :: Examine Image Control On A Form Programmatically

Jan 3, 2015

I have an Image control on a form which I want to examine programatically. It seems there used to be a way of doing it using Point and PSet from info I have seen online. Is this contained in any of the libraries available under References in Access and if so which one...

View 7 Replies View Related

Reports :: Changing Image In Control Crashes Access

Sep 16, 2014

On open I change the Picture property of an image control to another image. I do it 2 places. Access crashes on the first change or on the second. In about 50 % of the cases.

View 4 Replies View Related

Forms :: Refresh Image After Text Box Control Updated?

Oct 14, 2013

One of the fields in my database stores a path of an image that I want to display on my form. I used the following code in the "On Current" event of my form to achieve this effect:

Private Sub Form_Current()
If IsNull(Me.text1) Then
Me.ImgPic.Picture = "C:UsersharrDesktopCupCake.jpg"
Else
Me.ImgPic.Picture = Me.text1
End If
End Sub

It works great with the exception that the image doesn't update when the path is changed. If I update the path, I have to navigate to the next record and then back again in order to see the new image. I've tried a couple of things to try to requery the image after the text control is updated, but so far none have worked. This is my most recent attempt on the after update event of my text box:

Code:
Private Sub text1_AfterUpdate()
Me!ImgPic.Requery
End Sub

How I can refresh the image after the text box control is updated?

View 9 Replies View Related

Forms :: Linked Table - How To Assign Image To A Control In A Form

Dec 7, 2014

I have a linked table in ms access and it has a column as details. in ms access when i click on this button i will go to another form. i want to assign a picture (for opening a form) to this column but i don't know how i have to do this. my form opens as a datasheet view.

View 3 Replies View Related

Forms :: Save Form / WebBrowser Control - Contents To Image

May 17, 2014

I have a form that contains one WebBrowser Control. In this WebBrowser control I interact with the Google Maps API to produce a map.

I would like to save the contents of the WebBrowser Control (Google Map) to an image file. I have not been able to figure out how to do this.

The WebBrowser Control takes up all the space in the form. Perhaps the contents of the entire Form can be exported to an Image?

View 2 Replies View Related

General :: Control Source - Creating Image Based Off Drop Down Result

Feb 3, 2015

I am trying to create a image based off a drop down result. I have had no problem with setting up a image based off a static number. e.g 0456432 in the student id field will bring up students photo in the network share.

What I am having an issue with is the control source will look for a number instead of the name that the drop box displays. this is due to a separate table for the drop box.

what is the expression i need to make in order for the name to appear from the dropbox rather than the source id number?

View 3 Replies View Related

Forms :: Continuous Subform - Control To Display Image / Icon Based On Another Field

Jan 9, 2014

I have a continuous subform which queries a table of attachments. I'm using Access 2007 but not using the Attachment datatype; this DB will grow considerably and I don't want to waste precious space by filling it with bulky files. So instead, I have code which makes a copy of the attachment and adds the hyperlink (to the copy) to the table instead.

Now - I want to add a control to the subform to display an icon / image reflecting the file type of the attachment (Word doc, Excel s/s, PDF etc.)

But not sure how to go about it.

I was thinking I could use FileSystemObject.GetFileExtension at the point in the code where the attachment is added, and add a new field to my attachments table (i.e. translate "*.xls*" to "Excel", etc.) Then store / embed a handful of images for the core types I would expect and use an image control on the subform to display the image based on the value of that field.

But is that even possible / feasible?

Or, is there a handy API which can retrieve the icon associated with a file type based on what has been installed on the local machine (even if there is, there's still the problem of setting up the image control to display the appropriate icon specific to each record...)

Or, is there another control available which would be better suited to something like this than an Image control?

View 4 Replies View Related

Modules & VBA :: Identify Strings Into 2nd Table Records Then Update 1st Table

May 5, 2015

MS Access 2013: I have two database tables as below:

tbl1_MainDB --- It has a field named as "City" where I get huge data for some city names. Sometimes This field may have some unknown/new names which are not listed in our 2nd table ("tbl2_RefrDB")

tbl2_RefrDB --- It's a reference table which has raw names for cities, and then standard names of their city and state in another fields.

Target --- I want to create a VBA prorgram (Sql query) which can look from tbl1_MainDB.[City] to tbl2_RefrDB.[Raw_City] field, and if found then pick the "Standard_State" and "Standard_City" record values from there, and update into the 1st table "tbl1_MainDB".

...if not found in "tbl2_RefrDB" table, then user can be informed & ask for updating the new/unmatched city record as a new record in this table.

Attached sample database for more details.

View 4 Replies View Related

Modules & VBA :: Animate A Box Image?

Apr 11, 2014

im after trying to make an image on a splash screen rotate around on its centre as a loading icon?

Im guessing i will need a loop on the form opening?

View 1 Replies View Related

Modules & VBA :: Passing Image To Another App?

Dec 27, 2013

I want to use an On Click event on an image field on a subform to fire up either Windows Photo Viewer or Corel PaintShop Pro with that image active - but don't really know where to start. DoCmd, Shell ?

View 5 Replies View Related

Modules & VBA :: How To Add Icon / Image To List Box

Aug 15, 2013

is there any way to adding icon/image to the list box of ms access. what is the way?

View 1 Replies View Related

Modules & VBA :: Multiple Image In A Form

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

Modules & VBA :: Display Background Image Via Message Box

Mar 17, 2015

I have a report which is an invoice I have a button on the report to reprint It . Now if this is a duplicate Invoice I need to add a background Image ,something like a duplicate stamp . I have added a message box which says" is this a Duplicate Invoice" .If the answer is yes then I want to display the backgrond image and print the report .If the answer is no, then print report without background image

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved