i have a form with to photos that i can add
when i add does 2 photos or 1 photo then everything is ok
but when i add 1 photo and go back to add another photo then the first photo that i added is gone.
which ever photo i select and press edit it switches between them
only if i edit.
i checked the DB when i save for the first time and the 2 photos are there.
here is my code.
when i edit the form with the pics
with the subitems
in form load
one more thing
do i have do dim each photo as string or is there a way to dim 2 photos with a as something?
when i add does 2 photos or 1 photo then everything is ok
but when i add 1 photo and go back to add another photo then the first photo that i added is gone.
which ever photo i select and press edit it switches between them
only if i edit.
i checked the DB when i save for the first time and the 2 photos are there.
here is my code.
Code:
Dim CustPhoto As String 'this is the before picture
Dim CustPhotoAfter As String
Code:
Set rs = CN.Execute("SELECT CrdPhoto1,CrdPhoto2 FROM ColorCards WHERE CrdID= " & FrmColorCard.LsVw.SelectedItem.Tag)
CustPhoto = rs!CrdPhoto1
CustPhotoAfter = rs!CrdPhoto2
If Dir$(rs!CrdPhoto1) <> "" Or Dir$(rs!CrdPhoto2) <> "" Then
Set BttnPhoto.Picture = LoadPicture(rs!CrdPhoto1)
Set BttnAfter.Picture = LoadPicture(rs!CrdPhoto2)
CustPhoto = rs!CrdPhoto1
CustPhotoAfter = rs!CrdPhoto2
Else
MsgBox "the picture/s has been removed", vbExclamation
CustPhoto = ""
CustPhotoAfter = ""
Set BttnPhoto.Picture = Nothing
Set BttnAfter.Picture = Nothing
Code:
Set BttnPhoto.Picture = LoadPicture(CmmDlgBefore.FileName)
Set BttnAfter.Picture = LoadPicture(CmmDlgAfter.FileName)
itm.EnsureVisible
itm.Selected = True
Code:
CmmDlgBefore.InitDir = App.Path
CustPhoto = CmmDlgBefore.FileName
CmmDlgAfter.InitDir = App.Path
CustPhotoAfter = CmmDlgAfter.FileName
do i have do dim each photo as string or is there a way to dim 2 photos with a as something?