• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

Variable problems in dHTML

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
wilch101
Asked:
wilch101
  • 4
  • 3
  • 2
  • +1
1 Solution
 
AzraSoundCommented:
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
 
AzraSoundCommented:
oh and you should use txtName.Text
0
 
AzraSoundCommented:
never mind this is dhtml isnt it
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
MarineCommented:
Try using Document.txtname
0
 
jrmcgCommented:
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
 
jrmcgCommented:
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
 
wilch101Author Commented:
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
 
jrmcgCommented:
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
 
wilch101Author Commented:
Thank you for your help.  You saved me hours of reading.
0
 
jrmcgCommented:
No problem - if you have any trouble doing what I described just let me know...

J.R.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now