Sooo...I was told to start a new thread about this.

So I'm trying to make a link between TextBox1.Text on Form1 to TextBox2.Text on Form 2. What I currently have is a line of code underneath my TextBox2_Change code reading:
TextBox2 = Form1.TextBox1.Text

This ALMOST does what I want it to do. The only problem is that it is requiring me to input any character in to the TextBox2 when Form2 pops up before it displays.

I'm trying to get that problem solved and then I'm eventually going to try to get it to chop off part of the file name until just the project file name displays.......but that's a whole different game I'll be playing. One step at a time.

Does anyone have any suggestions?

Recommended Answers

Can you post the code you have so far?

Jump to Post

All 6 Replies

Can you post the code you have so far?

Sure thing. So, Form 1 is titled Browser. Here is the Browser code so far.

Private Sub Browse_Click()

Dim pathSelected As String 'This needs to be edited to find files, not just folders...alternatively, add .ipj to end
Dim ShellApp As Object
Set ShellApp = CreateObject("Shell.Application"). _
BrowseforFolder(0, "Choose Folder", 0, OpenAt)
pathSelected = ShellApp.self.Path
Me.TextBox1.Text = pathSelected
Set ShellApp = Nothing

End Sub

Private Sub Cancel_Click() 'Triggers the cancel command
Unload Me
End Sub

Public Sub Rename_Click()

Renamer.Show vbModal 'Shows Renamer form and changes active form
Browser.Hide 'Hides Browser form

End Sub

Form2 is title Renamer. Here is the Renamer code.

Private Sub Apply_Click()
'This will initiate Module 1 to do a batch rename to find and replace all
'Module 1 will then initiate the resolving links process
End Sub

Private Sub Cancel_Click() 'Triggers cancel button
Unload Me
End Sub

Private Sub Old_Name_Display_Change()

Old_Name_Display = Browser.TextBox1.Text 'Displays file name...after typing any character

End Sub

A WHOLE lot of stuff will be going on once I get the "Apply" button working. But I'm keeping the amount of code down as much as possible until then. Some of this probably isn't done as efficiently as possible...I learned Visual Basic on Friday, so new is an understatement. I've attached two files that show my forms as well.

i prefer to create function that return the value and call it from the other form like
you can also still get object value directly

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.