Solved

Variable problems in dHTML

Posted on 2000-04-07
10
181 Views
Last Modified: 2010-05-18
I am attempting to create my first web page using dHTML in VB.  I want to assign a string variable the contents of a text field on the screen when a button is pushed.  After Dimming the variable I am using

stName=Me.txtName.Value

I get an error with .txtName part of the line hightlighted stating that object or data method not found.  I've checked all names on the form and they are correct.  

It does work if I leave out the Me, but only on the same computer that the page was created on.  The code did absolutly nothing when the page was accessed on a remote computer.  I'm not real sure what the Me does.

any help would be appreciated.

Thanks
jw
0
Comment
Question by:wilch101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2694786
Me is the shortcut method to replace actually writing out the form name.  when you are writing code for a particular form within that form then you can replace any instance of it with Me but any references outside of the code for that particular form must refer to it as the form name.  try using just the regular form name
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2694791
oh and you should use txtName.Text
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2694794
never mind this is dhtml isnt it
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 6

Expert Comment

by:Marine
ID: 2695304
Try using Document.txtname
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 2698607
You can also try this:
Make sure that your text box has the
Name txtName as well as the id txtName
then use the following...

Document.All("txtName").Value
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 2698619
Also - you said that it doesn't work on a computer remotely -

How are you distributing the application?

The way you tried it originally should work if it is deployed correctly...

stName = txtName.Value

(without the Me)

Keep in mind that with the VBDHTML project you must build the CAB file and deploy the page.  The CAB is created and accessed like an object and is downloaded when the page is accessed from another computer.
If you are already doing this - another thing you can try is compiling the project with No Compatibility.  This will insure that the correct CAB is downloaded every time the page is accessed.  If you do not want to use No Compatibility then in the internet settings under temp files/ Object Settings - (IE4 + ) you must delete the objects that are stored there to make sure that you get the correct dll/CAB downloaded to the client.  If you need help with this let me know...

J.R.
0
 
LVL 1

Author Comment

by:wilch101
ID: 2701280
I was unaware of the CAB file.  If you could help me on how to create that file that would be greate.  Also do I need to do something special with the HTML file to attach to the CAB? or does it know which CAB has the dll for the page.

Thanks

jw
0
 
LVL 2

Accepted Solution

by:
jrmcg earned 95 total points
ID: 2701547
Sure - what version of vb are you using?

Do you have the Package & Deployment Wizard in your Visual Studio directory?


If so it will be easy...

When you package the project it will create a Package directory that will hold the HTML file and the CAB.  The HTML file in this directory will already have the proper CAB object installed.  You will not have to do anything else.

If you have the package wizard do this:

Start the wizard
select your project
select the Package option
it will probably ask you if you want to recompile if it does go ahead and recompile - if not that's ok too.
Select the type Internet Package
Next
Select the folder (should default to 'Package' in your project directory)
The next screen shows dependencies.  Select all of the files it has listed.
The next screen shows where you want to download certain files from.  The microsoft controls will (by default) attempt to download from Microsoft over the internet.
Select each file and choose Include in this CAB or however you want to do it.  The initial download on the client will take longer depending on your choices.  I always do mine in the CAB - this will increase the size of your CAB file if storage is an issue for you.
The next screen shows you all of your pages you have created all choices in the drop down boxes need to say 'Yes'.
On the next screen just hit 'Finish'
Your CAB will be created and your deployable HTML file will be updated (this does not change the working copy you are using during development)
For deployment - you can use the wizard or - just copy all HTML files and the CAB file to the web server directory that the pages are accessed on.

That's it.  You should now be able to access the page from any machine.

The CAB file will not be signed so the client machine will have to have security set up to either enable or prompt for unsigned Active X components.  If not they will get a message saying can't run the AX component.

To keep this from happening you would have to purchase the software that will sign your CAB files - you can get these from microsoft and other companies.

If you have any problems let me know

J.R.
0
 
LVL 1

Author Comment

by:wilch101
ID: 2701670
Thank you for your help.  You saved me hours of reading.
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 2701688
No problem - if you have any trouble doing what I described just let me know...

J.R.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question