|
-
Jul 19th, 2006, 07:46 AM
#1
Thread Starter
Lively Member
help me in open code
this is the save code
VB Code:
Private Sub Command1_Click()
CommonDialog1.ShowSave
Dim frm As Form
Dim ctl As Control
Open (CommonDialog1.FileName) For Output As #1
For Each frm In Forms
For Each ctl In frm.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is Label Then
Print #1, frm.Name & " : " & ctl.Name & " : " & ctl
End If
Next
Next
Close #1
End Sub
-------------------
my probleme is in the open code of this save code
this is the code
Private Sub Command2_Click()
CommonDialog1.ShowOpen
Dim colForms As Collection
Dim sParts() As String, sTemp As String, N As Long
Set colForms = New Collection
For N = 0 To Forms.Count - 1
colForms.Add Forms(N), Forms(N).Name
Next N
Open (CommonDialog1.FileName) For Input As #1
Do Until EOF(1)
Line Input #1, sTemp
sParts = Split(sTemp, " : ")
colForms(sParts(0)).Controls(sParts(1)) = sParts(2)
Loop
Close #1
Set colForms = Nothing
End Sub
-------------------
when i click in f5 button in microsoft visual basic look to this error
colForms(sParts(0)).Controls(sParts(1)) = sParts(2)
help me please
Last edited by RobDog888; Jul 22nd, 2006 at 10:56 PM.
Reason: Added [vbcode] tags
-
Jul 19th, 2006, 07:52 AM
#2
Re: help me in open code
What is the error you are getting?
Also could you please use the [Highlight=VB]Your code here[/vbcode] tags
-
Jul 19th, 2006, 08:00 AM
#3
Re: help me in open code
try changing this bit:
VB Code:
Line Input #1, sTemp
If Len(sTemp) Then
sParts = Split(sTemp, " : ")
colForms(sParts(0)).Controls(sParts(1)) = sParts(2)
End If
-
Jul 22nd, 2006, 12:47 PM
#4
Thread Starter
Lively Member
Re: help me in open code
Hii guys
This code dosnt work do you have any way or another code to get
the open code of it
please answer soon
regard's
milen
-
Jul 22nd, 2006, 10:49 PM
#5
Re: help me in open code
VB Code:
Private Sub Command1_Click()
Dim Frm As Form
Dim ctl As Control
CommonDialog1.ShowSave
Open (CommonDialog1.FileName) For Output As #1
For Each Frm In Forms
For Each ctl In Frm.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is Label Then
Print #1, Frm.Name & " : " & ctl.Name & " : " & ctl
End If
Next
Next
Close #1
End Sub
Private Sub Command2_Click()
CommonDialog1.ShowOpen
Dim sParts() As String, sTemp As String, N As Long
Open (CommonDialog1.FileName) For Input As #1
Do Until EOF(1)
Line Input #1, sTemp
sParts = Split(sTemp, " : ")
GetForm(sParts(0)).Controls(sParts(1)) = sParts(2)
Loop
Close #1
End Sub
Function GetForm(FormName As String) As Form
Dim Frm As Form
For Each Frm In Forms
If Frm.Name = FormName Then
Set GetForm = Frm
Exit Function
End If
Next
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|