Quick Help - In Need

This should be an easy correction, but I can't seem to figure it out, I am new to Visual Basic and need some help, badly.

This is your typical phonebook that stores info fields and 1 picture with each entry. Im just trying to make it store 4 pictures total, for each entry and I can't figure out the code for the life of me. I been searching the internet for over two-weeks and even rented out books from the library.

http://mywebpages.comcast.net/mex/help1.jpg

Help me please. VB6 Project files can be downloaded.. http://mywebpages.comcast.net/mex/dbimage.zip

Anyone with a working solution to this will receive a apreciation lump sum via PayPal.

Dim conServer As Connection
Dim rstData As Recordset
Dim updFlags As Byte

Private Sub cmdManipulate_Click(Index As Integer)
On Error GoTo Handler
Select Case Index
Case 0 'New
updFlags = 1 'Seting for New
Me.picEmp.Picture = LoadPicture("")
Me.Image1.Picture = LoadPicture("")
EnableFields ("New")
Case 1 'Modify
updFlags = 2 'For Modify
EnableFields ("Modify")
Case 2 'Save
With rstData
If updFlags = 1 Then .AddNew
![EmpName] = Me.txtEmpName
![EmpAge] = Me.txtAge
GetPhoto Me.lblPhoto.Caption, rstData, "EmpPhoto", "EmpPhotoSize"
.Update
End With
EnableFields ("Fill")
Case 3 'Cancel
EnableFields ("Fill")
FillData
End Select
Exit Sub

Handler:
On Error Resume Next
MsgBox "Error Occured While Handling Command" & vbCrLf & Err.Description, vbInformation
EnableFields ("Fill")
FillData
End Sub

Private Sub cmdNavigate_Click(Index As Integer)
On Error Resume Next
Select Case Index
Case 0 'First
rstData.MoveFirst

With cmdNavigate
.Item(1).Enabled = False
.Item(2).Enabled = True
End With

Case 1 'Previous
rstData.MovePrevious

With cmdNavigate
If rstData.BOF Then
.Item(0).SetFocus
.Item(1).Enabled = False
rstData.MoveFirst
End If
.Item(2).Enabled = True
End With

Case 2 'Next
rstData.MoveNext

With cmdNavigate
If rstData.EOF Then
.Item(3).SetFocus
.Item(2).Enabled = False
rstData.MoveLast
End If
.Item(1).Enabled = True
End With

Case 3 'Last
rstData.MoveLast
With cmdNavigate
.Item(1).Enabled = True
.Item(2).Enabled = False
End With
End Select
FillData
End Sub

Private Sub cmdPhoto_Click()
On Error Resume Next
With Me.cmDlg
.Filter = "All Graphic Files |*.Gif;*.Jpg;*.bmp;*.wmf;"
.DialogTitle = "Find Employee Photo"
.ShowOpen
Me.lblPhoto.Caption = Me.cmDlg.filename
Me.picTmp.Picture = LoadPicture(Me.cmDlg.filename)
Me.picEmp.Picture = picTmp.Picture
Me.Image1.Picture = Me.picEmp.Picture
Me.VScroll1.Max = (picEmp.ScaleHeight - Me.Picture1.ScaleHeight) / 5
Me.HScroll1.Max = (picEmp.ScaleWidth - Me.Picture1.ScaleWidth) / 5
End With
End Sub

Private Sub cmdPhoto2_Click()
On Error Resume Next
With Me.cmDlg
.Filter = "All Graphic Files |*.Gif;*.Jpg;*.bmp;*.wmf;"
.DialogTitle = "Find Employee Photo"
.ShowOpen
Me.lblPhoto.Caption = Me.cmDlg.filename
Me.picTmp.Picture = LoadPicture(Me.cmDlg.filename)
Me.picEmp.Picture = picTmp.Picture
Me.Image1.Picture = Me.picEmp.Picture
Me.VScroll1.Max = (picEmp.ScaleHeight - Me.Picture1.ScaleHeight) / 5
Me.HScroll1.Max = (picEmp.ScaleWidth - Me.Picture1.ScaleWidth) / 5
End With
End Sub

Private Sub cmdReset_Click()
On Error Resume Next
Me.HScroll2.Value = 0
Me.picEmp.Picture = Me.picTmp.Picture
End Sub

Private Sub Form_Load()
On Error GoTo Handler

Set conServer = New Connection
With conServer
.Provider = "Microsoft.Jet.OLEDB.3.51"
.ConnectionString = "Data Source=" & App.Path & "\DBPict.mdb"
.Open
End With

Set rstData = New Recordset
With rstData
.ActiveConnection = conServer
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "SELECT * From Employees"
End With

If getRowsOk(rstData) Then
rstData.MoveFirst
FillData
End If

Exit Sub

Handler:

MsgBox Err.Description & vbCrLf & "Unable to Connect to Database", vbInformation
Unload Me
Exit Sub
End Sub

'Checks if there are records in Recordset
Private Function getRowsOk(rst As Recordset) As Boolean
On Error GoTo Handler
Dim varData

varData = rst.GetRows(1)
getRowsOk = True
Exit Function

Handler:
getRowsOk = False
End Function

'Fills Data into Form
Private Sub FillData()
On Error GoTo Handler

With rstData
Me.txtEmpName = ![EmpName]
Me.txtAge = ![EmpAge]
Call FillPhoto(rstData, "EmpPhoto", "EmpPhotoSize", Me.picEmp)
Me.picTmp.Picture = Me.picEmp.Picture
Me.Image1.Picture = picEmp.Picture

Me.VScroll1.Max = (picEmp.ScaleHeight - Me.Picture1.ScaleHeight) / 5
Me.HScroll1.Max = (picEmp.ScaleWidth - Me.Picture1.ScaleWidth) / 5
End With

EnableFields ("Fill")
Exit Sub

Handler:
Exit Sub
End Sub

Private Sub EnableFields(State As String)
On Error Resume Next
Select Case State
Case "Fill"
Me.txtEmpName.Locked = True
Me.txtAge.Locked = True
Me.cmdPhoto.Enabled = False

With Me.cmdManipulate
.Item(0).Enabled = True
.Item(1).Enabled = True
.Item(0).SetFocus
.Item(2).Enabled = False
.Item(3).Enabled = False
End With

Case "New"
Me.txtEmpName.Locked = False
Me.txtAge.Locked = False

Me.txtEmpName = ""
Me.txtAge = 0

Me.cmdPhoto.Enabled = True

With Me.cmdManipulate
.Item(2).Enabled = True
.Item(2).SetFocus
.Item(3).Enabled = True
.Item(1).Enabled = False
.Item(0).Enabled = False
End With

Case "Modify"
Me.txtEmpName.Locked = True
Me.txtAge.Locked = False

Me.cmdPhoto.Enabled = True

With Me.cmdManipulate
.Item(2).Enabled = True
.Item(2).SetFocus
.Item(3).Enabled = True
.Item(1).Enabled = False
.Item(0).Enabled = False
End With
End Select
End Sub

Private Sub HScroll1_Change()
On Error Resume Next
Me.picEmp.Left = -5 * Me.HScroll1
End Sub

Private Sub HScroll2_Change()
On Error Resume Next
Screen.MousePointer = vbHourglass
SetBrightness Me.picTmp, Me.picEmp, HScroll2.Value
Screen.MousePointer = vbNormalFocus
End Sub

Private Sub VScroll1_Change()
On Error Resume Next
Me.picEmp.Top = -5 * Me.VScroll1
End Sub
[6825 byte] By [m333x] at [2007-11-20 2:12:36]
# 1 Re: Quick Help - In Need
Hi !
First at all welcome to dev-archive !
There are some rules in this forum, which should not be violated. So please:
1) Use Codetags as you can see this in the end of my post. This is necessary because in other way your code looks as it looks -- like an unreadable codesausage ;)
2) Never offer anythings for your help, because this is against any forum habits and will not be accepted by any member. We do this for personal honor and fun, not for payment

3) Only for clarifying: We are not coding for others full projects. If you need something like that you can set an announcement in the jobs section.

4) Please edit your code with usage of codetags and give some very specific questions what the problem is, what do you want to get as a product of the code snippet you showed us and what is not working as you want. if it crashes, which line - which errormessage. Help normally then is a very much shorter cycle and more successful then to go through you full code. :wave:
JonnyPoet at 2007-11-9 19:52:50 >
# 2 Re: Quick Help - In Need
I have tested the code you showed on the link. This works well, so whats your problem ? I didn't get you what you are needing If you want four pictures for every employee then simple store 4 of them If this is your code it really should be easy for you to do that. Also, whats the sence of the right picture ?
JonnyPoet at 2007-11-9 19:53:44 >
# 3 Re: Quick Help - In Need
I worked the code out, thanks alot for your help man and sorry I posted incorrectly, I won't do it again. Im having a Provider Error now that I can't worked out, Jet is installed, don't get it.
m333x at 2007-11-9 19:54:49 >
# 4 Re: Quick Help - In Need
Check / post connectionstring and full errormessage please

:wave:
JonnyPoet at 2007-11-9 19:55:54 >