How 2 "refresh" a search form after query??

NTeyeball

New member
Local time
Tomorrow, 08:17
Joined
Dec 23, 2011
Messages
6
Hi all,

For the life of me I can't get a Search Form to "refresh" after the query is closed?

So I have a simple search page, text and combo boxes, enter criteria for query, hit SEARCH button, the query displays, close.
From here I wish to clear the previous data still on the search form.??

I looked to see if I could add a line in the code for the "on click" of the SEARCH button, but its a macro.?

Any hints appreciated.
NT
 
Hi,

I'd delete the button and the macro, add new Search button and write the code to run your query in VBA (it is practically automatic with the wizard for the button). Where you'll have the code for "search" button, add this at the end:
text1.value=""
text2.value=""
.
.
cmb1.value=""
and maybe
text1.setfocus to put the cursor where you need it
 
dylan, rather than controlname.value to reference controls use Me.controlname.

The "Me." will give you intellisense so you won't have to type so much and it is more efficient for the interpreter because it tells the interpreter where the variable is defined. Without the "Me." reference, the interpreter has to search all loaded libraries until it finds "controlname.value". And finally, the Value property is the default property and so can be omitted to reduce coding.
 
Hi all,
Thanks for the responses guys!
Thanks Dylan, I understand.

Pat, age might be a factor here, at least I understood Dylan lol.
I have been with VB/VBA for a few years, just building as I need, ametuer.
Over the years Access has leaped ahead. It worked well earlier, and as new versions arose I admit I didn't pay much attention to New Features.
And admit I don't understand the new bits like Me.

When I get the time I will get around to learning more, too interested in punching out a solution to my needs.
Some call me old....lol , but with 60 getting very close, it keeps me occupied.

Thanks heaps guys!
NT.
 
Me has been with Access since the beginning. It is how you refer to properties and methods of the current form/report object. So for code running in frmA, Me.Name would = "frmA. Running the same code in frmB would return "frmB". If you open the class module for a form or report, observe what happens when you type Me. - as soon as you type the dot, you get a dropdown that contains all the properties and methods of that form/report.
 
Hi all,

Some call me old....lol , but with 60 getting very close, it keeps me occupied.

Thanks heaps guys!
NT.

60 is not old, plenty of learning years ahead. I spent yesterday walking and at 71 was the baby of the group, ok we only did 8 miles but in that time we put the world to right, and I learnt a lot about knitting from the ladies :D


Just realised I was 60 when I first came across Access at the charity I was working part time for, when I found this forum I used to study Pat's replies to problems as a way of learning what was available.
Brian
 
Hi guys,

I tell ya, I miss the community side of things.
Nice to meet you Pat, I thankyou for your comment. I actually understood that 2, well done.

Onya Brainwarnock ! way to go.

Commuters, programming, repairs and online help, have all been hobbies, until @ 55 I manage to walk into a coordinator position plus a Helpdesk position as well.
While the bills are good, I'm flatout with no social life...lol.
Thanks again for the warm reception. Very well done.
NT.
 
When you get time to relax again, take up Bridge. My mother-in-law is going to be 91 next month and still goes out to play at least twice a week. In Europe we have the WBF (World Bridge Federation) and I'm sure they have a website with links to games and classes. In North America we have the ACBL (American Contract Bridge League). Find them at www.acbl.org
 

Users who are viewing this thread

Back
Top Bottom