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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|