Click to See Complete Forum and Search --> : anyone here do VB?
drstrangelove
01-22-2001, 08:47 PM
I seem to be having a prob w/ VB.
I am VERY new to programming, and have a few questions.
If anyone here is keen to VB please post back here or email.
Thanks
Dr. Strangelove
YaRness
01-23-2001, 09:12 AM
i know someone does, because someone offered to help when i was working on my MS Access database. i just don't remember who it was.
------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
jenbass
01-23-2001, 09:39 AM
What's the problem? I can "do" VBA (vb for Office apps). In an inelegant kind of a way.
kweston
01-23-2001, 11:07 AM
I can probably help with VB, VBScript, or ASP, but I haven't done too much with VBA.
drstrangelove
01-23-2001, 11:12 AM
Well here's the deal...
I am trying to copy some files,
I have looked online and at a few different books, but i don't seem to have it done right apparantley.
Here is the code that is giving me poop.
I don't think that I am thinking about this the right way. I don't understand.
Private Sub Confirm_Win_DoIt_Butt_Click()
new_ant_DIR = Sel_New_Ant_Dir.Sel_New_Ant_Dir_Text.Text
new_ant_NAME = Sel_New_Ant_Win.Sel_New_Ant_Text.Text
cur_ant_DIR = Sel_Cur_Ant_Dir.Sel_Cur_Ant_Dir_Text.Text
Start_Win.Start_Win_Label = "You selected: " & new_ant_NAME & "as the name of your new antenna." & vbCr & vbCr & "You selected: " & new_ant_DIR & "as the directory containing your new antenna." & vbCr & vbCr & "You selected: " & cur_ant_DIR & "as your current antenna directory."
File2Copy.Copy (cur_ant_DIR & new_ant_NAME)
Set Fsys = CreateObject("Scripting.FileSystemObject")
Dim Fsys As New Scipting.FileSystemObject
Fsys.CopyFile new_ant_DIR & new_ant_NAME, cur_ant_DIR & new_ant_NAME, 0
End Sub
I don't like copying out of the book, rather, i like taking the ideas out of the books and making them my own, but this has got me really stumped. If this keeps up, I don't think i am going to make such a good programmer...
http://www.linuxnewbie.org/ubb/frown.gif
Any help is greatly appreciated.
------------------
Never go up against a Sicilian when death is on the line!!
Hahahahahahaha***
jenbass
01-23-2001, 11:20 AM
What is the error message you get when it tries to run? Does any part of it get highlighted?
The long line with the "&vbCr" - do you have that all on one line, and was it all on one line in the book you copied it from?
drstrangelove
01-23-2001, 11:26 AM
the only lines i copied from the book are:
Set Fsys = CreateObject("Scripting.FileSystemObject")
Dim Fsys As New Scipting.FileSystemObject
Fsys.CopyFile new_ant_DIR & new_ant_NAME, cur_ant_DIR & new_ant_NAME, 0
and I edited them to match what i am doing...
about the error message:
"compile error:
user defined type not defined"
and the top line of the code is highlighted.
Private Sub Confirm_Win_DoIt_Butt_Click()
------------------
Never go up against a Sicilian when death is on the line!!
Hahahahahahaha***
drstrangelove
01-23-2001, 12:01 PM
I did a little bit of searching, and I found this site...
http://www.freevbcode.com/
This is what worked for me:
I took out the:
'File2Copy.Copy (cur_ant_DIR & new_ant_NAME)
'Set Fsys = CreateObject("Scripting.FileSystemObject")
'Dim Fsys As New Scipting.FileSystemObject
'Fsys.CopyFile new_ant_DIR & new_ant_NAME, cur_ant_DIR & new_ant_NAME, 0
and I replaced it with:
FileCopy new_ant_DIR & new_ant_NAME, cur_ant_DIR & new_ant_NAME
i will be back though with more questions.
hehehe
------------------
Never go up against a Sicilian when death is on the line!!
Hahahahahahaha***
miller
01-23-2001, 01:38 PM
The problem was with this.
'Set Fsys = CreateObject("Scripting.FileSystemObject")
'Dim Fsys As New Scipting.FileSystemObject
The first line creates a filesystem object, using the implicitly declared FSys variable.
Then, the second line declares the FSys object again, and creates (another) new filesystem object.
You only need to pick one or the other, but never use both.
The correct code should be:
Dim FSys as Scripting.FileSystemObject
Set FSys = CreateObject("Scripting.FileSystemObject")