Should click the image frame then the picture show up

  • Thread starter Thread starter Frank Situmorang
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top