Should click the image frame then the picture show up

F

Frank Situmorang

Hello,

I have the field named: image path on my member table and then I have the
image frame on the page tab.

Here is the VBA on the image path control:
Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me!ImagePath = "C:\churchdata\" & Me![ImagePath]
If Not (IsNull(Me.ImagePath)) Then
Me.ImageFrame.Picture = Me.ImagePath
End If
End Sub

And here is the VBA on the pagetab:
Private Sub Household_Members_Click()
On Error Resume Next
If Not (IsNull(Me.ImagePath)) Then
Me.ImageFrame.Picture = Me.ImagePath
Else
Me.ImageFrame.Picture = "C:\churchdata\Nopicture.jpg"
End If
End Sub

Now the problem is ONLY when I click on image frame, then the photo shows up.

Anyone can help me please how can I make it when click the tab of the page,
the photo will show up?

Thanks very much for your help.
 
A

Arvin Meyer [MVP]

The Change event of the Tab control is the event to use instead of the Click
event, which fires for any page on the Tab control.
 
F

Frank Situmorang

Thanks very much Arvin, it works now perfectly.

Warmed Regards
--
H. Frank Situmorang


Arvin Meyer said:
The Change event of the Tab control is the event to use instead of the Click
event, which fires for any page on the Tab control.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Frank Situmorang said:
Hello,

I have the field named: image path on my member table and then I have the
image frame on the page tab.

Here is the VBA on the image path control:
Private Sub ImagePath_AfterUpdate()
On Error Resume Next
Me!ImagePath = "C:\churchdata\" & Me![ImagePath]
If Not (IsNull(Me.ImagePath)) Then
Me.ImageFrame.Picture = Me.ImagePath
End If
End Sub

And here is the VBA on the pagetab:
Private Sub Household_Members_Click()
On Error Resume Next
If Not (IsNull(Me.ImagePath)) Then
Me.ImageFrame.Picture = Me.ImagePath
Else
Me.ImageFrame.Picture = "C:\churchdata\Nopicture.jpg"
End If
End Sub

Now the problem is ONLY when I click on image frame, then the photo shows
up.

Anyone can help me please how can I make it when click the tab of the
page,
the photo will show up?

Thanks very much for your help.
 

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