UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Clearing An Editbox After Use, Access 2013    
 
   
David92595
post Jul 10 2017, 08:01 PM
Post#1



Posts: 522
Joined: 27-June 11
From: Temecula, California


I've only seen one or two posts about this and none of them seemed to have a definitive resolution.

I'm using http://www.accessribbon.de examples to as my bases (Thank's TheDBguy!)

I have an editbox that defaults to text when the db is opened using "getText" callback, in my instance it says "TS" which is our reference column. Once a user enters in a TS\Reference number the OnChange callback is called which runs code I have to open a form to the ID entered, it's great! But to use the edit box again my users have to clear what's in the editbox, hit enter, take the mouse back to the editbox to reset the focus and then type in the text search number. Is there a way to clear the editbox after it runs?

I've tried calling the code that the "getText" calls but haven't had any luck.

Is this possible? Please let me know if I need to post my code.

David92595
Go to the top of the page
 
theDBguy
post Jul 10 2017, 09:35 PM
Post#2


Access Wiki and Forums Moderator
Posts: 71,232
Joined: 19-June 07
From: SunnySandyEggo


Hi David,

Just curious, have you tried invalidating the control with the callback returning an empty string?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
David92595
post Jul 11 2017, 01:31 PM
Post#3



Posts: 522
Joined: 27-June 11
From: Temecula, California


I've tried and failed.

the code originally is
CODE
Sub MyEditBoxCallbackOnChange(control As IRibbonControl, strText As String)


I tried changing it to the below, but the line went red and did not allow me to proceed.
CODE
Sub MyEditBoxCallbackOnChange(control As IRibbonControl, strText As String) As String


I've also tried this, but I'm not sure how to pass another parameter to the call.
CODE
Sub MyEditBoxCallbackOnChange(control As IRibbonControl, strText As String, ByRef strText2)


I keep getting "Microsoft Access cannot run the macro or callback function 'MeEditBoxCallbackOnChange'. Make sure the macro or function exits and takes the correct parameters."

From this I'm guessing I need to pass something else to the onChange call now, but I'm not sure what or how.

David92595
Go to the top of the page
 
David92595
post Jul 11 2017, 03:21 PM
Post#4



Posts: 522
Joined: 27-June 11
From: Temecula, California


Got it. Thanks for the suggestion!
Go to the top of the page
 
theDBguy
post Jul 11 2017, 03:23 PM
Post#5


Access Wiki and Forums Moderator
Posts: 71,232
Joined: 19-June 07
From: SunnySandyEggo


Excellent! Glad to hear you got it sorted out. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 01:31 PM