|
-
Jun 5th, 2006, 03:33 PM
#1
Thread Starter
Frenzied Member
Assigning value in Form2 from Form1 thorws error. why?
Hi all,
I have two forms, Form1 and Form2 respectively. I have a command button in form1. I do some manipulations and finally I display the results in form2 using the following code:
VB Code:
With Form2
.lblResult = "This is a test result line 1" & vbcrlf & "This is a test result line 2" 'display the output in label.
.show vbModal
end with
If I run this code I got "Error no. 78; File/Path access error".
Anybody know what sort of error it is? and How can I avoid this?
CS.
-
Jun 5th, 2006, 03:42 PM
#2
Re: Assigning value in Form2 from Form1 thorws error. why?
What do you have in Form2 Load event?
-
Jun 5th, 2006, 04:43 PM
#3
Re: Assigning value in Form2 from Form1 thorws error. why?
cssriraman, using your code, and nothing else, I get the text showing on Form2 with no error.
Open a new project with 2 forms, a button on 1 and a label on the other, and it'll probably work.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jun 5th, 2006, 05:16 PM
#4
Thread Starter
Frenzied Member
Re: Assigning value in Form2 from Form1 thorws error. why?
Thanks!
@Al42 & RhinoBull:
I used the same thing in many projects and never had any issue.
You know what, I declared a public variable in Form2:
VB Code:
public strTemp as string
Private Sub Form_Load()
lblResult.Caption=strTemp
End Sub
And in Form1
VB Code:
With Form2
.strTemp = "This is a test result line 1" & vbcrlf & "This is a test result line 2" 'display the output in label.
.show vbModal
end with
This code worked fine without any issues.
Not sure what is the root cause for Path/file access error.
Is the Form2/form1 is corrupted or something? But I can open it, see/edit the code and can complie it.
-
Jun 5th, 2006, 05:21 PM
#5
Thread Starter
Frenzied Member
Re: Assigning value in Form2 from Form1 thorws error. why?
This happens to my current project only not on all projects.
-
Jun 5th, 2006, 10:55 PM
#6
Re: Assigning value in Form2 from Form1 thorws error. why?
Open the form files in Notepad and see if there's anything in there that shouldn't be. (Open a good form file in Notepad and compare, if you aren't familiar with what the file should look like.)
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
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
|