For Each & Variable Problem

Hello Chiefs,

At first, my English isn't very well so maybe it would look a bit curios what I write ;)

I have a Problem, I write a little Programm with VBA. Programm Users can type there Information about them (Name, Telephone Number...) and the Informations would saved in a XML File.
Now, the Informations who are between the XML Element Nodes (<ELEMENT>...</ELEMENT>) must be loaded in Textboxes from the Programm, before the User see the Programm Desk.
The Programm looks like so:http://img101.imageshack.us/img101/520/maskeaendern2aq.gif

Now the Code I have now looks so:


PrivateSub UserForm_Activate()

Dim xmlDocAsNew DOMDocument30
xmlDoc.async =False
xmlDoc.validateOnParse =False
xmlDoc.resolveExternals =False

xmlDoc.Load ("Z:\Memberinformation.xml")


Dim ndMemberListAs IXMLDOMNodeList
Dim ndMemberAs IXMLDOMNode

Set ndMemberList = xmlDoc.selectNodes("//MemberInformation/Member/*")

1. -->Set TextBox =

WhileNot (ndMemberIsNothing)

Set ndMember = ndMemberList.NextNode

ForEach TextBoxIn formMaske
2. -->If TextBox.Text = NullThen
TextBox.Text = ndMember.Text

Wend


Now, 1. Problem, in the Variable TextBox would I sign to all Textbox Objekts in the Mask, but I don't know how to make that.
2. I thinke the For Each Code is false. But I don't know what I must write there exactly.

Thanks for helping

greetz Whisky / Sam

[2500 byte] By [MajorWhisky-w] at [2008-2-6]
# 1
Hi,
If we understood your first question correctly, and you want the text box to be masked by “******”, you can use TextBox1.PasswordChar method to mask your textbox. If you want to add the textbox control to the form (I notice you use foreach in formmaske), there is no need, controls will be added to the form automaticlly, you can use foreach to access your textbox controls from UserForm1.Controls.

Second problem, foreach is used like this:

For Each rCell In Cells

If rCell.Value = "Find Me" Then

rCell.Activate

Exit For

End If

Next rCell

please let us know if the engineer understood your question correctly and this was helpful to you.

thanks,
-brenda (ISV Buddy Team)

MSISVBuddyTeam at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...