My Assistant
![]() ![]() |
|
|
Mar 29 2012, 04:06 PM
Post
#1
|
|
|
UtterAccess Enthusiast Posts: 88 |
Hi!
I have a cbo that allows for searching the form for specific information, I also have navigation buttons to move between records. Is there a way that if I click one of the navigation buttons the name in the cbo is cleared so not to confuse the user? I looked at the options for the "onClick" macro, but since I don't know what some of them do, I couldn't find what I was looking for...any help? Thanks |
|
|
|
Mar 29 2012, 04:09 PM
Post
#2
|
|
|
Access Wiki and Forums Moderator Posts: 47,962 From: SoCal, USA |
Hi,
What version of Access are you using? Please remember to select the version number when posting questions in case it becomes relevant to the discussion. You can clear out the combobox as soon as you're done with the search function, or you can clear it in the Current event of the form. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Mar 29 2012, 04:10 PM
Post
#3
|
|
|
UtterAccess Enthusiast Posts: 88 |
I'm using Access 2007. Do you mean to manually clear it before moving around in the form?
|
|
|
|
Mar 29 2012, 04:11 PM
Post
#4
|
|
|
Access Wiki and Forums Moderator Posts: 47,962 From: SoCal, USA |
I'm using Access 2007. Do you mean to manually clear it before moving around in the form? No. You can do it in code with something like: Me.ComboboxName = Null Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Mar 29 2012, 04:15 PM
Post
#5
|
|
|
UtterAccess Enthusiast Posts: 88 |
Great, thanks!
|
|
|
|
Mar 29 2012, 04:16 PM
Post
#6
|
|
|
UtterAccess VIP Posts: 9,283 From: Wisconsin |
Kattracks,
EDIT: DBGuy beat me to the punch, but I'll leave this here anyway. (IMG:style_emoticons/default/smile.gif) You should be able to use the OnCurrent event for the form to accomplish this. Something along the lines of: Me.NameOfYourCombobox = Null If you're really new to this sort of thing, here's the process: 1. Open your form in Design View 2. Open the Properties box, if necessary 3. Select the Events tab on the Properties box Since you only opened the form, and haven't clicked on anything, the Properties box should say "Selection type: Form" near the top. If not, click on the little square just below the form's title bar (above the ruler on the left, just left of the horizontal ruler at the top) to select the form. 4. Click once on the white area of the "On Current" section in the properties box to select it. A small button with three dots will appear to the right. 5. Click the little button with three dots to go to the Visual Basic Editor. You should now be in a whole new window, with a white background for typing in. You probably see this on your screen: CODE Private Sub Form_Current() End Sub 6. Copy/Paste the line of code from earlier in this mesage between those two lines of code. Change the name of the combobox to the name you actually use for that combobox. That should do it. Close & Save Changes, then re-open your form and try navigating both with your Navigation buttons and your combobox to make sure it works. Hope this helps, Dennis |
|
|
|
Mar 29 2012, 04:20 PM
Post
#7
|
|
|
Access Wiki and Forums Moderator Posts: 47,962 From: SoCal, USA |
Hi,
Great, thanks! (IMG:style_emoticons/default/yw.gif) Dennis and I are happy to help. I like that he has more detailed instructions in his post. Good luck with your project. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 05:11 AM |