Open Form Parameter

NHC

New member
Local time
Today, 13:26
Joined
Aug 23, 2006
Messages
9
I've run into a strange problem. I'm trying to have an image box that you can double click and it will open a different form with a full sized image. When I open my form with the larger image, it asks me for a Parameter Value. Is there any way to stop it from asking me for that? Also, what is a parameter value and should I be typing something there?


Any ideas you may have would really help me out. Thanks a lot in advance!!
 
Also: Is there a way to keep my large image form open or to have it reopen when I double-click the image box. Here is the event procedure for the image box:
Private Sub ImageDisplay_DblClick(Cancel As Integer)

Dim identity As String
Dim destination As String

destination = "frmFullPicture"
identity = Forms!frmDescription!AlternateIDNumber.Value
DoCmd.OpenForm destination, acNormal, , "[ObjectID] =" & identity, , acWindowNormal
End Sub
If I close my large image form, it brings up error messages. I tried to put that code in a module as a crude way to reopen it every time I change records, but it wouldn't let me put that in code in a module.
 
Try This

Code:
DoCmd.OpenForm destination, acNormal, , "[ObjectID] =[COLOR="Red"]'[/COLOR]" & identity[COLOR="red"] & "'"[/COLOR], , acWindowNormal

Hope this helps?
 
It got rid of the parameter problem, but now it says "The OpenForm action was canceled""Runtime Error 2501" Any ideas?
 
Try leaving off "acNormal" and "acWindowNormal"

DoCmd.OpenForm destination, , , "[ObjectID] = '" & identity & "'"

If that doesn't work you may have some other code in the form that you are opening (Maybe in the OnLoad or OnOpen event) that is causing a conflict.
 
That parameter problem is now solved. Thanks a lot! Any ideas on the how to keep the other form open all the time or to have it reopen everytime I double-click? If it gets closed it gives errors every time you flip between records. I have to manually re-open it everytime. Thanks again!
 
Instead of passing the parameter when opening the form you might want to try opening the form with no parameters, setting a filter then turn on the filter.

DoCmd.OpenForm "frmFullPicture"
Forms!frmFullPicture.Filter = "[ObjectID] ='" & identity & "'"
Forms!frmFullPicture.FilterOn = True

You might also want to search around to find a function to check if the form is already loaded. If you can't find one, you can probably check to find out what error number is returned and in you error handler add the following.

If Err.Number = The error number Then
Resume Next
End If

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom