A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

option group and text box query help



 
 
Thread Tools Display Modes
  #1  
Old December 5th, 2006, 11:55 AM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default option group and text box query help


Hello,

on my main form I have two search facilities. One is an employee name search
that will go to the record when entered. The second is an option box that
will filter the records for each department (but also includes an option for
all records).

I have already tried a couple of ideas which don't quite work. What I would
like is an "on enter" event so that when the cursor is placed in the text
box, the "show all records" option in the option box is automatically chosen.

cheers!


--
How many buildings collapsed on 9/11?

I can tell you the answer isn''t 2 !!
  #2  
Old December 5th, 2006, 12:43 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default option group and text box query help

Have you tried adding code to the OnEnter event of the textbox, something
like:

Me!YourOptionGroup = 1

(or whatever number belongs to the option you want chosen)?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


"scubadiver" wrote in message
...

Hello,

on my main form I have two search facilities. One is an employee name

search
that will go to the record when entered. The second is an option box that
will filter the records for each department (but also includes an option

for
all records).

I have already tried a couple of ideas which don't quite work. What I

would
like is an "on enter" event so that when the cursor is placed in the text
box, the "show all records" option in the option box is automatically

chosen.

cheers!


--
How many buildings collapsed on 9/11?

I can tell you the answer isn''t 2 !!


  #3  
Old December 5th, 2006, 01:42 PM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default option group and text box query help

The option does change when I insert the cursor into the box but the filter
isn't removed. I can't really think of an alternative than a warning message
box.

I don't think it is too much of an issue but it could be. I just thought it
would be a good idea.


"Jeff Boyce" wrote:

Have you tried adding code to the OnEnter event of the textbox, something
like:

Me!YourOptionGroup = 1

(or whatever number belongs to the option you want chosen)?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


"scubadiver" wrote in message
...

Hello,

on my main form I have two search facilities. One is an employee name

search
that will go to the record when entered. The second is an option box that
will filter the records for each department (but also includes an option

for
all records).

I have already tried a couple of ideas which don't quite work. What I

would
like is an "on enter" event so that when the cursor is placed in the text
box, the "show all records" option in the option box is automatically

chosen.

cheers!


--
How many buildings collapsed on 9/11?

I can tell you the answer isn''t 2 !!



  #4  
Old December 5th, 2006, 02:01 PM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default option group and text box query help


I have another query. In another form I want to filter the data on a field
called [RateID] and I only want the rate to =1.

I have put [RateID]=1 into the "filter" line on the "data" tab but it isn't
working.

I have tried using a filtered query as the source (which does make sense)
but I also have a subform and I don't know how to link a query and a table.



"Jeff Boyce" wrote:

Have you tried adding code to the OnEnter event of the textbox, something
like:

Me!YourOptionGroup = 1

(or whatever number belongs to the option you want chosen)?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


"scubadiver" wrote in message
...

Hello,

on my main form I have two search facilities. One is an employee name

search
that will go to the record when entered. The second is an option box that
will filter the records for each department (but also includes an option

for
all records).

I have already tried a couple of ideas which don't quite work. What I

would
like is an "on enter" event so that when the cursor is placed in the text
box, the "show all records" option in the option box is automatically

chosen.

cheers!


--
How many buildings collapsed on 9/11?

I can tell you the answer isn''t 2 !!



  #5  
Old December 5th, 2006, 02:09 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default option group and text box query help

Use the form's Filter and FilterOn properties. I would also suggest the
GotFocus event:

Private Sub txtSomeControl_GotFocus()

Me.opgFilter = 1
Me.FilterOn = False
'I think the FilterOn will force a requery, but if not
Me.Requery

End Sub

(Actually, no buildings went down, The Shadow is masking our minds so we
can't see them

"scubadiver" wrote:


Hello,

on my main form I have two search facilities. One is an employee name search
that will go to the record when entered. The second is an option box that
will filter the records for each department (but also includes an option for
all records).

I have already tried a couple of ideas which don't quite work. What I would
like is an "on enter" event so that when the cursor is placed in the text
box, the "show all records" option in the option box is automatically chosen.

cheers!


--
How many buildings collapsed on 9/11?

I can tell you the answer isn''t 2 !!

  #6  
Old December 5th, 2006, 03:02 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default option group and text box query help

What happens if you also add the code to either change the filter to (?)
something like "" (a zero-length string) or possibly turn off the
AllowFilter property?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


"scubadiver" wrote in message
news
The option does change when I insert the cursor into the box but the

filter
isn't removed. I can't really think of an alternative than a warning

message
box.

I don't think it is too much of an issue but it could be. I just thought

it
would be a good idea.


"Jeff Boyce" wrote:

Have you tried adding code to the OnEnter event of the textbox,

something
like:

Me!YourOptionGroup = 1

(or whatever number belongs to the option you want chosen)?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


"scubadiver" wrote in message
...

Hello,

on my main form I have two search facilities. One is an employee name

search
that will go to the record when entered. The second is an option box

that
will filter the records for each department (but also includes an

option
for
all records).

I have already tried a couple of ideas which don't quite work. What I

would
like is an "on enter" event so that when the cursor is placed in the

text
box, the "show all records" option in the option box is automatically

chosen.

cheers!


--
How many buildings collapsed on 9/11?

I can tell you the answer isn''t 2 !!




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.