Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manual update vs. programically updating field

Status
Not open for further replies.

mikelev

Technical User
Mar 23, 2004
223
US
I have a field PATH the stores the path to the the picture displayed.

I also have a label that when clicked opens a browser dialog to select the picture, which returns the path value to the PATH field. This works fine, but causes me to go to the next record then back to my record to see the image change.

Code:
Private Sub Label328_Click()
    Me![path] = GetOpenFile_CLT("C:\StraightEdge\Pictures", "Select client image")
End Sub

When the path is updated using the above method, the AfterUpdate event does not fire. When the path is modified by changing the text in the PATH field the event DOES fire. I tested this by puting a "Stop" command in the AfterUpdate event.

Am I missing something? I am trying to get the record to save on AfterUpdate and display the new image.


Cheers,
 
The after update event of controls is supposed to fire only when information is entered manually. You could issue a me.refresh or something though, or call the after update event of the other control in code - or another way that often works to force the after update programaticly, is to set focus to the control, and use the .text property:

[tt]Me![path].setfocus
Me![path].text = GetOpenFile_CLT("...[/tt]

Roy-Vidar
 
Howdy RoyVidar!

I was able to get it to work using the Call Form_Current method.


Posted just a bit to early!

Thanks as always.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top