THere's soemthing I just don't understand about programming (and this may sound stupid)... I can do the if's and else if's etc etc but I'm not sure how to write a series of commands to make something happen. Below, is code which deletes two files and then copies two files in their place. Can you just type it as I have done line after line or is there something i have to do? All of the books i ever read seem to show you the bits I already know ;o(
Private Sub cmdImageRemove_Click()
On Error GoTo Image_Error
Dim n, o, p, msg, btn As String
Dim IDPath, ThumbImage, ThumbLocation, ThumbImagePath As String
Dim Image, Location, ImagePath As String
Set f = CreateObject("Scripting.FileSystemObject"
'the id to use as the file name...
IDPath = txtImgID.Text
'locations/destinations for the thumbnail...
ThumbImage = "U:\VB Movie Image DB\jpg\thmb_0000.jpg"
ThumbLocation = "U:\VB Movie Image DB\jpg\netvisual\thumbnail\"
ThumbImagePath = ThumbLocation & "thmb_" & IDPath & ".jpg"
'locations for the standard images...
Image = "U:\VB Movie Image DB\jpg\0000.jpg"
Location = "U:\VB Movie Image DB\jpg\netvisual\"
ImagePath = Location & IDPath & ".jpg"
'for the message box to check whether to delete image or not...
msg = "Are you sure that you want to remove this image?" & Chr(13) & Chr(13) & "The image will be deleted and the record in the database will be updated."
btn = vbOKCancel + vbDefaultButton1 + vbQuestion
'starts the process to delete the images...
n = MsgBox(msg, btn, "Remove the Image?"
If n = vbOK Then
'********THIS IS WHAT I'M UNSURE ABOUT********
Kill (ThumbImagePath)
Kill (ImagePath)
f.CopyFile ThumbImage, ThumbImagePath
f.CopyFile Image, ImagePath
o = MsgBox("The image has now been deleted...",
vbInformation, "Confirmation"
End If
Exit Sub
...sorry for sounding so thick but you'll never know if you never ask ;o)
Thanks All....
Private Sub cmdImageRemove_Click()
On Error GoTo Image_Error
Dim n, o, p, msg, btn As String
Dim IDPath, ThumbImage, ThumbLocation, ThumbImagePath As String
Dim Image, Location, ImagePath As String
Set f = CreateObject("Scripting.FileSystemObject"
'the id to use as the file name...
IDPath = txtImgID.Text
'locations/destinations for the thumbnail...
ThumbImage = "U:\VB Movie Image DB\jpg\thmb_0000.jpg"
ThumbLocation = "U:\VB Movie Image DB\jpg\netvisual\thumbnail\"
ThumbImagePath = ThumbLocation & "thmb_" & IDPath & ".jpg"
'locations for the standard images...
Image = "U:\VB Movie Image DB\jpg\0000.jpg"
Location = "U:\VB Movie Image DB\jpg\netvisual\"
ImagePath = Location & IDPath & ".jpg"
'for the message box to check whether to delete image or not...
msg = "Are you sure that you want to remove this image?" & Chr(13) & Chr(13) & "The image will be deleted and the record in the database will be updated."
btn = vbOKCancel + vbDefaultButton1 + vbQuestion
'starts the process to delete the images...
n = MsgBox(msg, btn, "Remove the Image?"
If n = vbOK Then
'********THIS IS WHAT I'M UNSURE ABOUT********
Kill (ThumbImagePath)
Kill (ImagePath)
f.CopyFile ThumbImage, ThumbImagePath
f.CopyFile Image, ImagePath
o = MsgBox("The image has now been deleted...",
vbInformation, "Confirmation"
End If
Exit Sub
...sorry for sounding so thick but you'll never know if you never ask ;o)
Thanks All....