Using a calendar to control a test box

Chris1985

Registered User.
Local time
Today, 10:05
Joined
Jul 2, 2013
Messages
33
I am trying to allow a calendar to search through a text box with a large amount of data in which will have headings using the date so i wanted to use a calendar search. Hopefully this will be be like the find function in word where you type (or in this case select a date) then click search or next which will take you to that specific date.
 
How do I do it?!?!
 
By using the InStr() function and SelStart and the SelText property.
If you can't do on your own, I'll try to design for you the cod. But this will cost you a beer. Deal ?
 
Deal, lol! Thanks... Sorry to be a pain I have changed the functionality of doing this. I Have now decided a better and probably easier way. Is it possible to create a search box (textbox) which searches through another textbox with a lot of information in? The way i am trying to do this is i have a text box whihc users will enter data with their name and date so if i were to create a search box (e.g. when you are in word you can go CTRL and F which brings up a search box that takes you to the search, you would then click next to see if the search matches anything else within that document) is it possible to create this? If you could help me out with this i will get you a case of beer not just the one!! :)
 
Seems to be the easiest beer that I gain ever :) .
That because the CTRL+F has (have) the same functionality in Access as in Word.
Why you don't try this ?

Is this enough for your needs ?
 
HI Mihail, this function does not allow you to search the specific textbox. is there code that i could put with a button so that when i have typed data in one textbox it searches through another one (with a lot of data in) to find the specific text.
Thanks.
 
In my A 2007 (under Windows 7) this function allow to search in a specific textbox.
Of course by make the right settings.

Ok. I'll design right now an approach.
 
Thank you, Thank you, Thank you!! If there is aything i can ever do to help you please let me know!! again Thank you this is just what i was looking for!!
 
Hi Mihail,
just a quick question i am probably missing something but i am getting an error saying 'Run-time error '94': Invalid use of Null. Any idea how to stop this? it seems to refer to the line - TextToFind = txtFindWhat
 
Run-time error '94': Invalid use of Null

This error was coming up a the start and all i have done is changed names of the textboxes.

Option Compare Database
Option Explicit
Dim Msg As VbMsgBoxResult
Dim StartText As Long
Dim TextToFind As String
Dim TextToBeSearched As String
Private Sub Form_Current()

StartText = 0
TextToFind = txtFindWhat <----------------------------------- This is where the error is coming up
TextToBeSearched = NOTES & ""

cmdFindNext.Visible = (Trim(txtFindWhat) & "" <> "")

End Sub
Private Sub txtFindWhat_Change()
Beep
cmdFindNext.Visible = (Trim(txtFindWhat.Text) & "" <> "")
If Not cmdFindNext.Visible Then
Exit Sub
End If

StartText = 0
TextToFind = txtFindWhat.Text
TextToBeSearched = NOTES
End Sub
Private Sub cmdFindNext_Click()
StartText = InStr(StartText + 1, TextToBeSearched, TextToFind)
If StartText = 0 Then
Msg = MsgBox("The text """ & txtFindWhat & """ is (no more) finded", vbInformation)
StartText = 1
Exit Sub
End If

NOTES.SetFocus
NOTES.SelStart = StartText - 1
NOTES.SelLength = Len(TextToFind)

End Sub
 
Of course that is happen if you change the name of my textbox without change this name in all code.
So, you need Find and Replace the name I have used with the new name in ALL code.

And TURN ON the OPTION EXPLICIT !!!!!!!!!!!!!!!!! in your VBA editor.
 
i have sorted it now thanks Mihail! i have already turn on the the option explicit and i had already changed the names of all the textbox to suit my DB. The problem was that it was retrieving a null file so would not load fully. I have sorted it by changing:

TextToFind = txtFindWhat

to

TextToFind = Nz(txtFindWhat)

this resolved the error.
 
So, you intoxicate me with false information. Another beer because this.

" If there is anything i can ever do to help you please let me know!!"
I already have a list. May I send you ?

Ok. I'm happy because I can help you.

And, indeed you can help me, if you wish and if you have enough time. And WHEN you have time.
I like to learn English from an English guy.
So, if you can do this, contact me on messenger (alt.mihai@yahoo.com).
Again, only if you WISH to do this. If not is also OK, and I'll help you here any time I can.

Good luck !
 

Users who are viewing this thread

Back
Top Bottom