Re: Passing text boxes between forms
- From: "Randy Birch" <rgb_removethis@xxxxxxxx>
- Date: Wed, 25 Jan 2006 22:07:02 -0500
just to throw out a possible alternative ...
http://vbnet.mvps.org/code/project/findreplace.htm
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
Please reply to the newsgroups so all can participate.
"David Bland" <DavidBland@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8A41E603-AD52-48D8-BFCA-9953358EB8D6@xxxxxxxxxxxxxxxx
: Hi
:
: I am trying to write a search text routine, but I was hoping to do it from
: one form to another i.e a Find (crtl F) type form. I have a text box on
one
: form (Main) and another form (Search) with a text box to enter the test
and a
: find button. When I click the find button I want it to take the text
entered
: on the Search form and search the text on the Main form. I currently get
the
: follwoing message Object variable or With block variable not set, can some
: one help or is there a control that will do this for me ?
:
: Main Form
:
: Private Sub Command1_Click()
:
: Dim ourSearch As SearchForm
: Set ourSearch = New SearchForm
:
: ourSearch.TextBoxIn = txtECPAPI
: ourSearch.Show
:
: Set ourSearch = Nothing
: End Sub
:
: Search Form
: Private mstrTextBox As Textbox
:
: Public Property Get TextBoxIn() As Textbox
: TextBoxIn = mstrTextBox
: End Property
:
: Public Property Let TextBoxIn(ByVal TextBoxVal As Textbox)
: mstrTextBox = TextBoxVal
: End Property
:
: Private Sub cmdFindNext_Click()
:
: Dim lngPos As Long
: Dim lngTemp As Long
: Dim strFind As String
:
: strFind = txtSearchString
:
: lngPos = 1
:
: lngPos = InStr(lngPos, TextBoxIn.Text, strFind, vbTextCompare)
: lngTemp = lngPos
:
: If lngPos > 0 Then
: HighlightText TextBoxIn, strFind, lngTemp
: lngStrPos = lngPos + Len(strFind)
: End If
.
- Follow-Ups:
- Re: Passing text boxes between forms
- From: David Bland
- Re: Passing text boxes between forms
- Prev by Date: Re: Determining if file is open by another process
- Next by Date: Re: Interfacing question
- Previous by thread: Re: Passing text boxes between forms
- Next by thread: Re: Passing text boxes between forms
- Index(es):
Relevant Pages
|