refer to subform controls problem

G

Guest

Im having main form that is used to add new recors (Data Entry = True) and i
have a subform in this form in wich im showing image. so when somebody inputs
data to main form there is a textbox on which if he will double click it it
will load the picutre in sub form, and its working perfectly it loads the
picture in sub form but i think it makes the new record to lose focus so u
can not continue adding the date couse it triggers update event. So every
time im loading a picture thats it my new data has to be sent to database.
How to be able to load a picture to a subform and then normally continue
entering the rest of new data
thank u for help
 
R

ruralguy via AccessMonster.com

I guess the question might be - why do you feel you need a SubForm to display
the picture? Could you just display the picture in a control on the MainForm?
 
G

Guest

Yes i understand but i have lots of forms that will display pictures and i
was thinking to solve it with just one subform so everytime i will want to
make a change on how the image is diapleyed im not going to change it in 13
different forms.
Althouth this totally would work,
but im hoping there is a solution

thanks
 
R

ruralguy via AccessMonster.com

Marek,
That is a good reason to do what you are doing. Let me and others reading
this thread give it some thought. You might want to post whatever code you
are using to display the picture so we can review it.
Yes i understand but i have lots of forms that will display pictures and i
was thinking to solve it with just one subform so everytime i will want to
make a change on how the image is diapleyed im not going to change it in 13
different forms.
Althouth this totally would work,
but im hoping there is a solution

thanks
I guess the question might be - why do you feel you need a SubForm to display
the picture? Could you just display the picture in a control on the MainForm?
[quoted text clipped - 9 lines]
 
G

Guest

the code is very simply :
the problem apears when im passing an object from subform (Me![podglad
scanow].Form!MiDocView1) to the function loadImage. Then i guess it takes a
focus out the new record and update it

In main form on textbox dbl click event i have:

Private Sub TextBoxExample_DblClick(Cancel As Integer)
loadImage TextBoxExample, path, Me![Sub form].Form!MiDocView1
End sub

The loadImage function:

Public Sub loadImage (kontrol As Object, path As String, MiView As Object)

If Not Dir(path) = "" Then

Set MiDoc = New MODI.Document

MiDoc.Create path
MiView.Document = MiDoc
MiView.FitMode = miByWindow
MiView.ActionState = miASTATE_PAN
End if
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top