Match typed text and forward to that record

nac1987

New member
Local time
Today, 03:43
Joined
Oct 15, 2013
Messages
4
Hi there, I'm stupid and I need all the help I can get.

I've got an access form, and all I want to do, is to be able to type a number into a text box, click a button and then for the record containing that number to be displayed (in that same form).

-And I dunno where to start.

I don't like using the navigation bar, although that is almost what I'm after!

Also, search functions I've seen on here that use combo box lists to display results seem like too much for me, as each number typed into my search box will be unique.

Am I making sense? And if so, is there any one out there who can help me? Save me superman. :D Or woman. Don't mind at all! :D
 
Last edited:
assuming the number is the full value in the field you are looking for then in the on click event of your button put

Code:
Me.Filter="[tableNumberFld]=" & me.txtbox
me.FilterOn=True
 
Remember when I said I was an idiot? Here's the proof.
2 lines of code and I'm done-for.

It almost works... see the attached file (if you can spare the time), i'm getting some annoying box that pops up, not sure why. :(

Also, once it works, how do I then kill the filter to search again? -is that gonna be another button? Ha! :o
 

Attachments

You need to learn the difference between text and numbers. you said
all I want to do, is to be able to type a number into a text box
but your codes are text - e.g. BMA00198507.

So your vba needs to be

Code:
Me.Filter = "[tblData.code]='" & Me.SearchFor & "'"
Me.FilterOn = True
Also, once it works, how do I then kill the filter to search again? -is that gonna be another button? Ha!
Can be, or just enter another code
 
Smashing stuff, seriously.

I'm in constant awe of people like you!

I'll try this filter-kill bit as it seems to trip up when trying to simply search again. Hmm.

If I get stuck, please don't be surprised if I sheepishly ask for help again.

But cheers! :)
 

Users who are viewing this thread

Back
Top Bottom