Re: Passing text boxes between forms
- From: "David J Mark" <nntp45534-22@xxxxxxxxxxxx>
- Date: Wed, 25 Jan 2006 16:16:13 GMT
"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 ?
Step one. Document which line is throwing the error. Everybody know what
the Find dialog does.
>
> 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: Recordset.State = 0
- Next by Date: Re: Best control to display a good deal of data for review only?
- Previous by thread: Recordset.State = 0
- Next by thread: Re: Passing text boxes between forms
- Index(es):
Relevant Pages
|