Prevent Cursor From Moving On Image / Form Change

Feb 8, 2007

I've created a form. Within that form I have an image control. I am using this code to pull the corresponding plant image from a folder filled with JPGs.

It works just fine except one thing. When I change from record to record my cursor jumps to the center of the pulled JPG. I don't want my cursor to move at all when loading these images. Is this possible? Thanks.


Private Sub Form_Current()

Dim FileExistsbol As Boolean
Dim stFileName As String

stFileName = CurrentProject.Path & "- Landscaping Material Images" & _
[LandscapeCommonName] & ".jpg"
stFileName = Trim(stFileName)
FileExistsbol = Dir(stFileName) <> vbNullString

If FileExistsbol Then
[LandscapeMaterialImage].Visible = True
Me![LandscapeMaterialImage].Picture = stFileName
[LabelNoPictureAvailable].Visible = False
Else
[LandscapeMaterialImage].Visible = False
[LabelNoPictureAvailable].Visible = True
End If

End Sub

View Replies


ADVERTISEMENT

Forms :: Cursor Moving On Multi Subforms In A Form?

Mar 6, 2015

Issue with Cursor moving on multi Subforms in a form.

I have 2 sub-forms in a main form as per screenshot. So Cursor moving from main form to 1st subform working well. After can't move the cursor from 1st subform to 2nd subform with tabbing or entering. Still there in 1st Subform in the last entered filed after tabbing or entering. I've checked on tab orders also they shown correct but it is can't move to 2nd subform.

View 2 Replies View Related

Help With Code For Moving Cursor

Jun 16, 2005

First I am no good with code so I need your help!
I have code that tells the cursor to move to a certain field.

Private Sub Form_Current()
ClaimNumber.SetFocus
End Sub

It works for the most part - our problem with this is if we have the form open and we are searching on a different field say "Last name" when we click find next it finds the first one but if we click find next again it tells us that there is no records. This is because the cursor has moved to the ClaimNumber field.

Is there a way I can modify this code to say move the cursor only on a new record.

Any help would be great!

View 2 Replies View Related

Modules & VBA :: Prevent The Blinking Cursor From Appearing?

May 13, 2014

I have a single text box with a vertical scroll bar being used as a user guide. The Locked property is set to Yes so no user input can be made.

How do I prevent the blinking cursor from appearing?

View 2 Replies View Related

General :: Moving Cursor Position In Email Message Body

Nov 14, 2012

Is there an automatic way of moving the cursor when an outlook email is opened using a VBA event??

Right had a look and haven't managed to google this yet but the background is as follows

I have some code that puts a recordset of people's email into outlook and leaves users with the outlook message open ready for them to append anything they want to the message body.

At the moment the cursor flashes at the very start of the message and users need to scroll down with keys or the mouse to the end before they can add additional text.

I want to automatically move the cursor to the end of the outlook email message opened using a VBA event?

View 3 Replies View Related

User Change Image On Form

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

How Do I Change An Image (Ole Object) In A Form When Changing Value Of A Combo Box?

Mar 14, 2007

My Db has 1 table with 4 columns named ID, First_name, Last_name and Photo.

ID is a counter and primary key.
First+last names are text fields.
Photo is an Ole object.

I display everything in a form that is controlled by a combo box. The combo box displays the first name and when I chage the first name with this box the last name changes too. I use this code together with the event "after update"

Code:Private Sub Combo_First_name_AfterUpdate()Me.txt_last_name.Value = Me.Combo_first_name.Column(2)

Everything works perfectly fine (txt_last_name changes according to the first name in the combo box), except that the photo of the person doesn't change. Nothing happens to the photo when changing value in the combo box or it just displays a message box with an error messages when I have tried to get it to work.

I want the ole object picture to change too, when changing the first name in the combo box.

I hope you can help me out here.

View 4 Replies View Related

Cursor Change

Oct 7, 2005

Does anyone know how to change the Cursor to an animated picture, or any picture for that matter?

I want to change the cursor while I am stalled out in a little FOR NEXT loop......then once I get out of the loop return to the default cursor.

THanks in Advance

View 1 Replies View Related

Forms :: Image Change Based On Combo Box Selection On Form

Jun 21, 2015

I have been looking some information on changing image based on form combo box selection on form.

I manage to do case by case but i need it in a simple code because their will be many employees just to avoid adding case by case code for each one.

Private Sub Emp_IDCombo_AfterUpdate()
Select Case Emp_IDCombo.Value
Case "AM-001"
Imageholder.Picture = "C:UsersAMGDesktopam-001.jpg"
Case "AM-002"
Imageholder.Picture = "C:UsersAMGOne DocumentsHR & Admin DatabaseEmployee Picturesam-002.jpg"
End Select

I have employees table where all images location is saved in text field and i have a combo box on form which is employee id.

Tables relationship
Employees_table [PK] to Contracts_table [FK] via field name {emp_ID}

Fields Name
Combo Box name on form Emp_IDCombo and row source is SELECT Employees_table.Emp_ID, Employees_table.EmployeeName, Employees_table.Emp_Pics FROM Employees_table;

Text field is located in employees_table called [Emp_Pic] for images location.

View 10 Replies View Related

Forms :: Keep Mouse Cursor At The End Of Text Box After On Change Event Procedure?

Oct 30, 2013

I made an On Change Procedure on a textbox, so everytime I input a character, it will trigger the Me.Requery.

However, after that the event, the mouse cursor moved to the beginning of other field. I want it to stay at the end of the textbox so I can enter a full word, how do I do that?

Code:

Private Sub Text73_Change()
ProjectSearch = Me.Text73
Me.Filter = "[Project Name] Like " & Chr(34) & ProjectSearch & "*" & Chr(34)
Me.FilterOn=True
Me.Requery
End Sub

View 3 Replies View Related

Delete Or Prevent Records After Cbo Change ?

Sep 5, 2006

Hello, I HAVE searched the forums for many days but I could not find a solution. Maybe I'm not sure what to look for...

The MAINFORM_1(single form view) is based on a Query and has a cbo named 'cbo_client'. This cbo is for a field named [client_id]. The AfterUpdate [event] of 'cbo_client' does a requery on a field in the the following SubForm:

In the SUBFORM_1(datasheet) (based on another Query) is another cbo named 'cbo_subclient', with a select statement of 'Select (all the needed fields) FROM tbl_subclient WHERE ((([tbl_subclient].[subclient_id])=[Forms]![mainform_1]![cbo_client])).

Everything (incl. the REQUERY) works fine, and all the tables gets updated with the records the way it should. No problems.

But this is where i get stuck...: Once the user has entered data in the SUBFORM_1 datasheet, and then >changes the 'cbo_client'< on the MAINFORM_1, it requery the subform like it should, BUT the previously entered data in the subform is already written to the table!

So, I need a way to prevent the data in the subform from beiing stored if the user changes the cbo on the mainform (for a second time). OR prevent the cbo on the mainform from beiing changed after the subform is completed.

I hope you understand what I'm trying to do...

Please, just a point in the right direction and i'll battle it out from there.

Thank you.

View 5 Replies View Related

Moving Database - How To Change Path To New Location

Jan 10, 2013

I am new to Microsoft access. I have a database moved from another computer. it is split into the backend and the front end..

However, when i click on the forms in the front end, I get an error message. It is trying to use a path from the old computer, to the database, but its on a different computer.

So, this brings me to my question, how do i change the path, to the new location

View 1 Replies View Related

Modules & VBA :: How To Prevent Access Change String To Date

Dec 23, 2014

I wrote a VBA code to get the field value of a csv file, then use it to update the database table. I paste some of my code below

Dim objConn As New ADODB.Connection
Dim objRs As New ADODB.Recordset
Dim objUpdate As ADODB.Connection

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & theFolderName & ";Extended Properties='text;HDR=Yes;FMT=Delimited'"

[Code] ....

1. The target of this code is to set the [Section] value in the table
2. The [Section] value is at the 3rd column inside the csv file
3. By using the UPDATE query, it map the [Section] value to the corresponding [Program] and [Course] in the table

This code did the job. But the problem is the string of the [Section] value is like "2-22-01". But after update to the table, the value become "2/22/2001".

The value is a string text, not date. How can I prevent this happen ?

I just attached 2 files, 1 mdb and 1 txt (change the extension to csv before test).

View 3 Replies View Related

Auto Image Change

Sep 30, 2005

I have a form with cbo and the following code:

Private Sub cboOrderLocation_AfterUpdate()
If Me!cboOrderLocation = "Paradigm" Then
Me!txtOrderLocation = "PA"
Me!txtExpressAddress = "Paradigm Address"
Me!imgSelect = "LogoSmall.jpg"
ElseIf Me!cboOrderLocation = "Unassigned" Then
Me!txtOrderLocation = "NA"
Me!txtExpressAddress = "Not Assigned"
ElseIf Me!cboOrderLocation = "Express" Then
Me!txtOrderLocation = "EX"
Me!txtExpressAddress = "Slover Address"
Me!imgSelect = "LogoSmallParadigm.jpg"
End If
End Sub

The Me!txtOrderLocation and Me!txtExpressAddress both work great! I want to have it change the logo / image the same way. Is this possible? If so can someone tell me or show me how? I created an image on the form with the name imgSelect but when I compile it of course is giving me an error.

Thanks!

View 1 Replies View Related

Click Image Hyperlink In Form To Load Image To Form

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

Change Colour Of Image Border

Apr 14, 2005

...but I'v got a picture and I want to put a red box behind it so the picture looks like it has red borders, the problem is that the box always appears above the picture, I'm sure there must be a way to prioritize them or something but I can't find it!

View 3 Replies View Related

Linked Image Path Change Doesn't Work?

Mar 18, 2008

Hello. I've searched and read a few threads concerning image controls on forms and haven't been able to find a solution to my problem (yet). Anyway, I have a form with two image controls (imgOK1 & imgOK2). The previous and current setting of the "Picture" property for both images is set to "C:MOMGraphicsfilename.bmp". The location of my images has changed and will change for each user which is "C:Documents and Settingsuser.nameMOMGraphicsfilename.bmp". I'm using the following code to set the .Picture property on form load:

Dim ImgPath
ImgPath = "C:Documents and Settings" & Environ("username") & "My DocumentsMOMGraphics"
Me.imgOK1.Picture = ImgPath & "imgButton-OK1_25%.bmp"
Me.imgOK2.Picture = ImgPath & "imgButton-OK2_25%.bmp"

When the form is opened, an error stating that the image located at "C:MOMGraphicsfilename.bmp" cannot be found; once for each image control. Then the form loads and .Picture properties appear to be set correctly as they are displayed fine. I've tried to clear the .Picture properties for both image controls using the properties editor but the original path returns as soon as the property loses focus. Is there a way to programatically set this property and make it stick so the errors are not displayed?

View 7 Replies View Related

Forms :: Change Image Back Color On Click

Apr 30, 2014

I have images in my form, say, Image1 and Image2 . The default background color for all of them are white. If the user click image1, the background color has to be red. If the user click image2, the background has to change to red and the image1 retains its default color ( White ).

I have six images to loop through these. Image1 to image6.

View 8 Replies View Related

Position Of Cursor On New Record On A Form

Aug 21, 2006

I'm trying to ensure that each time a new record is opened in a form, that the cursor is positioned in the first control/field... I have this throughout most of my application but not in a few individual forms.

I know I've done something in the past to ensure that this happens, but I can't remember what it was...

Thanks,
Peter

View 2 Replies View Related

Tabbed Form Flashes When Cursor Hovers Over Buttons

Feb 1, 2005

I have a client using an access DB that I have built. It was built using Access 2000 and he is running it on Access 2003. The problem is that when he opens one of the forms which is tabbed and he moves to the second page when he moves the mouse pointer over some hyperlink buttons the background colour ,which is normally blue flashes to yellow. Every other user working with 2000 does not have this problem. I cannot find the reason. Can anyone help please?

View 1 Replies View Related

Forms :: Continuous Form Cursor Jumping Around On Entry

Mar 5, 2015

I have checked the tab order and have cycle for my form set to = all records (but have also tried current record). After I update one of any of my textboxes in the details section and then click or tab into the next box, the cursor jumps back to the first record, first field.

View 1 Replies View Related

Forms :: Main Form To Subform Cursor Position

Oct 31, 2013

On main form cursor working is goods as per default. But after come to in Subform its shown the cursor position in the last filed. So every new record is shown as the same last field. How to do this cursor position will be change in subform as per default?? and every new record its need to show as per default TabIndex "0".

I have checked my Tab Index & Order Settings also it is good. But its shown as last filed in subform

I have attached the Screen shot.

View 7 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

Prevent Form From Displaying New Record And Save It When Form Requery Or Close

Aug 26, 2014

I have a split form that's like a list of pending tasks. The data source is a linked SharePoint 2013 list where users submit requests. The user takes the information from each record and performs an action. When it is done, the user presses a button and the task status changes from "Pending" to "Processed". The form record source is based on a query that finds only records with a status of "Pending" so when the user changes the status of the task, it is removed from the list. It works fine except when there is only one task left in the work list. If the user processes the last task, the form refreshes and it goes to a new empty record and I get an error message that says I must enter a value into one of the required fields. I tried making the field non-required but it just creates an empty record in the table.

View 3 Replies View Related

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

Prevent Form From Opening

Oct 5, 2005

I need to prevent a form from opening if
no data (no picture) is found in an image
control on the form that needs to be
opened.
The form is opened in this manner:

DoCmd OpenForm StDocName,,,stLinkCriteria

Certain records will not have a picture so the
form doesn't need to be opended.

Thank you

View 8 Replies View Related







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