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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating values

Status
Not open for further replies.

Gaylord

Technical User
Sep 26, 2002
49
0
0
DE
Hi,

I am currently creating a database, that on selecting an incident number allows the user to open one of several images in a single image area (to save space). This is working pretty well, apart from I have to use a separate list box to display the result, which you then click on before a command button.

I know this is some kind of refresh command problem but I am having trouble finding where this is called from. The button works "on click".

Any help would be appreciated.,

Best regards

Jamie
 
OK. So the user selects an incident number from a combo box, which produces a value in a list box(?), the user then clicks the list box, and finally clicks the command button to see the photo. I will be honest. I don't quite understand what you have going on? Would you please post some code so that we can see exactly how you are pulling the image, etc.
 
OK, more information.

I use a query to select all the incident codes for a drop down list. From here you select a value which is also related to an image (via another query). I want to be able to select this image by clicking on a button which uses this code....

Private Sub View_Patient_Comments_Click()

Dim Picture As Image
Dim ImagePath As String

ImagePath = "c:\images\"

ImageArea.Picture = ImagePath & [Forms]![Main Form]![CommentName]

Exit_View_Patient_Comments_Click:
Exit Sub

Err_View_Patient_Comments_Click:
MsgBox Err.Description
Resume Exit_View_Patient_Comments_Click

End Sub

However the [Forms]![Main Form]![CommentName] doesn't seem to refresh unless I place that into a text box and select it before clicking the button.

Any idea why?

Best regards

Jamie
 
Private Sub View_Patient_Comments_Click()

Dim Picture As Image
Dim ImagePath As String

ImagePath = "c:\images\" & [Forms]![Main Form]![CommentName]

ImageArea.Picture = ImagePath
ImageArea.Refresh

Exit_View_Patient_Comments_Click:
Exit Sub

Err_View_Patient_Comments_Click:
MsgBox Err.Description
Resume Exit_View_Patient_Comments_Click

End Sub


Thanks for the extra info. I have modified your code above. Assuming that [CommentName] is the file name, the code above should update the image whenever you click on the button.

You may also want to consider doing away with the command button. This situation could be set up so that whenever the second selection (image value) is made, the image updates automatically. I personally prefer this method since it removes extra clicks for the user (thus making it more "user friendly"--an evasive balance to obtain [surprise] ).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top