Dialog Form Enabling OK button

Please help with a conceptual problem...

I have an unbound dialog form that I call up for the user to enter a
couple of values that will then be used for some calculations.  I
don't want the OK button to enable until all the text boxes are filled
in.  Normally, I would include a data check routine that would get
called from the afterupdate event on each text box.  If all the text
boxes had a value (that was inside predetermined ranges), the OK
button would be enabled, otherwise not.

Pretty standard stuff...

Now, one pesky user has complained that after he's done entering the
last value the OK button doesn't enable until and unless he tabs off
the last text box.  Sure enough, that's the way AfterUpdate works.  He
wants it so that immediately upon entering a value in the last text
box, the OK button will enable.  I got to say there is a certain logic
to that...

So, I've tried just about every event for the text boxes and form that
I can think of (dirty, keypress, etc), but nothing will fire.  What
event should I be using to call the data check routine and enable the
OK button so that it reacts immediately to data entry and doesn't wait
for the user to move off the text box?

Thanks

0
Tom
10/26/2007 2:51:23 PM
access 16762 articles. 3 followers. Follow

5 Replies
568 Views

Similar Articles

[PageSpeed] 1

What you need to do in the AfterUpdate event of the last textbox is enable 
the button. Make sure that the button is in the Tab Order just after the 
last textbox. (In Design View ... View >>> TabOrder) Then he can hit enter 
twice and the button code fires.

The only other event that you can use is the Change event, which will fire 
after the first character is typed in the textbox.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Tom" <rtmnews@swbell.net> wrote in message 
news:1193410283.035082.244070@v3g2000hsg.googlegroups.com...
> Please help with a conceptual problem...
>
> I have an unbound dialog form that I call up for the user to enter a
> couple of values that will then be used for some calculations.  I
> don't want the OK button to enable until all the text boxes are filled
> in.  Normally, I would include a data check routine that would get
> called from the afterupdate event on each text box.  If all the text
> boxes had a value (that was inside predetermined ranges), the OK
> button would be enabled, otherwise not.
>
> Pretty standard stuff...
>
> Now, one pesky user has complained that after he's done entering the
> last value the OK button doesn't enable until and unless he tabs off
> the last text box.  Sure enough, that's the way AfterUpdate works.  He
> wants it so that immediately upon entering a value in the last text
> box, the OK button will enable.  I got to say there is a certain logic
> to that...
>
> So, I've tried just about every event for the text boxes and form that
> I can think of (dirty, keypress, etc), but nothing will fire.  What
> event should I be using to call the data check routine and enable the
> OK button so that it reacts immediately to data entry and doesn't wait
> for the user to move off the text box?
>
> Thanks
> 


0
Arvin
10/26/2007 3:15:48 PM
Arvin:

Thanks - your first suggestion is what I normally do, but the user
complains that lacks intuitive obviousness (i.e., he thinks that you
shouldn't have to move off the last text box to enable the OK button -
the mere act of entering a valid value in the last text box should
enable the OK button - I can't disagree with that viewpoint).

I tried the Change event, but the problem is that the text box doesn't
have a value yet (because the user hasn't move off it yet) so my data
validation fails.  I'd normally just set the form.dirty = false, but
that doesn't work with unbound forms.

So, a slight reposing of the question...  How do I get the currently
displayed text in a text box as it is being editted in an unbound form
without moving focus off the text box.

Thanks

0
Tom
10/26/2007 3:34:31 PM
IIRC, I think the value you're looking for is the .text value... so
ctl.text is the displayed (even if uncommited) value. So have in the
change event for the last control (the one he doesn't want to tab off,
which I don't blame him for).

If ctl.text <180  then me.button.enabled = true

(Obviously, changing names and criteria :D)

Hope that helps...

On Oct 26, 11:34 am, Tom <rtmn...@swbell.net> wrote:
> Arvin:
>
> Thanks - your first suggestion is what I normally do, but the user
> complains that lacks intuitive obviousness (i.e., he thinks that you
> shouldn't have to move off the last text box to enable the OK button -
> the mere act of entering a valid value in the last text box should
> enable the OK button - I can't disagree with that viewpoint).
>
> I tried the Change event, but the problem is that the text box doesn't
> have a value yet (because the user hasn't move off it yet) so my data
> validation fails.  I'd normally just set the form.dirty = false, but
> that doesn't work with unbound forms.
>
> So, a slight reposing of the question...  How do I get the currently
> displayed text in a text box as it is being editted in an unbound form
> without moving focus off the text box.
>
> Thanks


0
germaine
10/26/2007 6:20:32 PM
You must not have tied the Change event of the textbox. That fires with 
every keystroke.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Tom" <rtmnews@swbell.net> wrote in message 
news:1193412871.593984.303900@57g2000hsv.googlegroups.com...
> Arvin:
>
> Thanks - your first suggestion is what I normally do, but the user
> complains that lacks intuitive obviousness (i.e., he thinks that you
> shouldn't have to move off the last text box to enable the OK button -
> the mere act of entering a valid value in the last text box should
> enable the OK button - I can't disagree with that viewpoint).
>
> I tried the Change event, but the problem is that the text box doesn't
> have a value yet (because the user hasn't move off it yet) so my data
> validation fails.  I'd normally just set the form.dirty = false, but
> that doesn't work with unbound forms.
>
> So, a slight reposing of the question...  How do I get the currently
> displayed text in a text box as it is being editted in an unbound form
> without moving focus off the text box.
>
> Thanks
> 


0
Arvin
10/27/2007 3:25:02 AM
Thanks - the .text property was the part that I was missing!  Never
used that before.

Tom

0
Tom
10/29/2007 1:24:19 PM
Reply:

Similar Artilces:

A form to be filled in and then to be used for a query
Hi ! I'm using MS Access 2003. In my table I have yes/no fields F1 to FN. In my query I want to select records from this table according to the values of F1, ... , FN. I want to use an entry form for specifying my query. My entry form will have checkboxes for specifying the values of F1, ..., FN. A record is to be selected from my table whenever it has "yes" values for all fields checked in the entry form. (Unchecked fields are ignored .) To carry out the query, I would like to check the values in the entry form, then push a button to have another form show up which display...

Linking Outlook fields from the "Contact Folder" to a custom form in Outlook...
Using Exchange Server 2003/Outlook 2003, we have created a custom Help Desk form in Outlook. We would like the ability to link specific fields from the Contacts Folder (Example B), in a drop-down list box if possible. We are far from knowing that something like this is even possible. Would appreciate *any* suggestions. Thank you. ...

Ok stupid Q time....
I know this is probably a very simple thing to do but I cannot find how to change it.. In my form I have set up tab stops, they go all the way through... What I want to do is when the tab stops at a drop-down box the user can then use the up and down arrows to look through it, then press enter to select the one they have highlighted. At the moment when you use up or down it moves forward or back to the tab stops. I have been looking for the solution but have yet to find it although I know in the past I have set it up before on previous forms long gone. Thank You :-) -- Message posted via...

Positioning of Dialog at Startup
Hi I need to position a dialog's position. Is it necessary to use SetWindowPlacement? Because i dont need to change any ither parameter. Only the x & y coordinates have to be changed. Is there a simple way out SetWindowPos(NULL,x,y,width,height,SWP_NOZORDER I think that's all you need. Check the different SWP_ flags in the help to see what they do. ...

Forms like the Invoice Template
I would like to design some of my own business forms similar to the Invoice template that comes with Excel 97. Can someone point me in the right direction to get started? Thanks, -- B Try: http://www.microsoft.com/downloads/details.aspx?FamilyID=5c619eb3-950b-4fc3- 8df4-88fb9ee83dc6&DisplayLang=en Watch word wrap here... HTH "Bradley M. Small" <BSmall@XNOSPAMXmjsi.com> wrote in message news:u1ZKd9YvDHA.4060@TK2MSFTNGP11.phx.gbl... > I would like to design some of my own business forms similar to the Invoice > template that comes with Excel 97. Can someone point ...

How to access macros via tool buttons?
Excel v2007 When using v2003, I had many macros In my Personal.xls, which I accessed via custom tool buttons on many custom toolbars that I built. I now have version 2007, which includes my old Personal.xls with all my macros, but I want the easy access to those macros I used to have. Being the tool ribbon is a different system, what is now the strategy for fast button-clickable launching of macros? Are buttons built, menus, what? [I already know about the Quick Access Toolbar, but I have over a hundred macros I previously had divided onto several toolbars that I'd hide and s...

Can my form fill in a field, yet allow me to override?
Each customers is sent to us from a salesman, and we provide service for 1-7 days before the activity ends. A new charge is generated for each day of service. Employee #1 uses the customer service form to generate a bill, and includes the name of the salesman. Employee #2 uses the form to generate a bill on the next day, and has to look up the first bill, in order to know which salesman to record. The same thing happens every day until the activity ends. With each new referral for service, there's a strong chance it will be due to a different salesman, so the customer number an...

Search directly in a form
I have some members in av form, and I want to be able to in [FirstName] to just type inn the persons name and search an get hold of all the persons data in the form. Is there an easy way to do this? -- Tom R. Thorstensen On Tue, 8 Jan 2008 07:31:04 -0800, Tom R. <tomrth@broadpark.no> wrote: >I have some members in av form, and I want to be able to in [FirstName] to >just type inn the persons name and search an get hold of all the persons data >in the form. Is there an easy way to do this? Yes. On the menu select Records... Filter... Filter by Form. Type search terms in...

how can we transfer data from child dialog box to parent Dialog Box. #2
hi guys, i have created modalless child dialog box by parent dialogbox using UI Thread . now i want to do 2 things first i want to transfer CPoint variable from child to parent and second i want to call OnLButtonDown() function of parent DialogBox. i have hint but not proper please help me to complete this one. SendMessage(m_pParent, WM_LBUTTONDOWN, x,y); // from child side void CHRS_MoleDlg::OnLButtonDown(UINT nFlags, CPoint point) //on parent dialog box first of all tell me is it possible if yes then what will be "x" and "y" so that they can convert into CPoint v...

Forms problem #2
Hi all, I've designed a form in MSO 2003 with a picture for a background and the bcc field having a default value. The problem is that when I send attachments through this form sometimes the recipient gets the attachment as a .dat file! I like the functionality of the form that I've created but the problem with the attachments is a big one! Any suggestions? -pnp Do not use Outlook Rich Text as the form message format. Use Plain Text or HTML instead. The winmail.dat is caused by clients that cannot understand RTF (all except Outlook/Eudora) wrapping the formatting in the .da...

ADP in A2007 Runtime: Traditional binding of form to stored procedure taking no parameters no longer works
Forms in ADP can have a stored procedure as the RecordSource. Traditionally we could write: RecordSource="dbo.EmployeesList" (or use the RecordSourceQualifier to specify "dbo"). On A2007 runtime this no longer works: The record source 'EmployeeList' specified on this form or report does not exist. On A2007 (with or without the /runtime command line switch) it does work. The only workaround I have found so far is to put the entire expression in the RecordSource property like this: "exec dbo.EmployeesList". I don't think this is an intentional change b...

word or excel documents as web forms
Dear Mr or Mrs, I was just wondering if anyone has had a similar goal before. We have numerous word and excel docs in our company. I was wondering if there is a way to create those as web forms and bind them to a database. We dont have a problem with creating a database to fit the need. I know that an easy workaround would be to code asp.net pages from the word and excell docs but i just thought it might be worth while to ask. Having the word docs and excel docs would make printing really easy and all formating. Looking forward to any advice Sincerely Dan If you are ...

Using Trebuchet MS Font : Bold and Italic not in Font Dialog
I've read that you should use the actual "bold variant" family of a font instead of just choosing "bold" (because the latter would just make it heavier and you might lose some definition/character). 1. Is this true? 2. When In use Trebuchet MS in Publisher or Word 2003 they don't show the bold or italic versions that are in the Font folder (Trebuchet MS Bold,etc.) Do they just automagically use the bold family when you bold something? And, if so (BONUS QUESTION) : is this better, the same, or worse "looking" than a font with a special different f...

How to disable CSpinButtonCtrl button
Hi, I just came across a piece of my old MFC code that I want to improve: A CSpinButtonCtrl is used to let the user browse through some database result sets. What I want to achieve is: When the first result is displayed, the left-arrow button of the CSpinButtonCtrl shall be disabled and when the user reaches the last result right-arrow button shall be disabled. I'm wondering what the easiest way to disable one of the two buttons is? Thanks, Guido ...

form: data input locking up
Hello all... I have a form which was working fine until a few hours ago. The form has several sub forms. However, those are working fine. I am unable to edit/add/delete records on the main form. This is a front end database, with the main data storage on a network. I moved the data starage DB onto my local drive, reset the links and experienced the same problem. The form is not based on a query and writes directly into a data table. The form is normally called up (filtered) through code. however, I experience the same problem when I open it up directly (without filtering the re...

Gray Close Button
Hi there I just want to gray/disable the close and the maximize button in a dialog, but the minimize button should stay active. In the dialog editor of VC++ 6.0 you can only erase all buttons or gray the minimize/maximize button, so there must be something with code? greets lori >I just want to gray/disable the close and the maximize button in a >dialog, but the minimize button should stay active. In the dialog >editor of VC++ 6.0 you can only erase all buttons or gray the >minimize/maximize button, so there must be something with code? Lori, To disable the close button you c...

Global change for forms
Marshall Burton and Douglas Steele gave me some great code for global changing the fonts on all my forms and reports. I now want to globally change the backcolour of the forms and subforms. can anyone help me with the code. Please note I'm not a VBA expert but learning slowly! Thanks Tony On Wed, 18 Jul 2007 19:44:12 +0100, "Tony Williams" <tw@invalid.com> wrote: >Marshall Burton and Douglas Steele gave me some great code for global >changing the fonts on all my forms and reports. I now want to globally >change the backcolour of the forms and subforms. ca...

Eliminate / Hide Title Bar on a form
Is there any way in VB 2008 to hide the Title Bar on a form? I have a dedicated computer which is going to run only my application. I want to at a minimum to hide the Min/Max/Close buttons on the title bar, but would actually prefer to simply not have it at all. Thanks, John "John Tripp" <JohnTripp@discussions.microsoft.com> wrote in message news:D5DE09C2-EB11-4DA9-A3E2-DDC3BEE54DAB@microsoft.com... > Is there any way in VB 2008 This group is for VB6 and earlier(VB Classic). VB.Net and all dotnet groups have either "dotnet" or "vsnet&qu...

Modal and Modeless dialog boxes
I have a modeless dialog box and also modal dialog box in some application. When both appear I would expect the modal box to eliminate any access apart from it but I can access the modeless as well and it could get focus just as the other box. Is that normal or am doing something wrong? Can I force the focus to be only on the modal box? Thanks Gil Gil wrote: > I have a modeless dialog box and also modal dialog box in some application. > When both appear I would expect the modal box to eliminate any access apart > from it but I can access the modeless as well and it could ge...

File in 2007 form
I was trying the Beta Office 2007 and made the mistake of saving one of you Excel file in the new 2007 form. I really need it back in the 2003 form. Problem: due to a variety of issues, I de-installed the Beta version and went back to 2003 but for got about the one file.. So; are there any utilities that anyone knows of the will convert this file back two 2003 form?? It is a simple Excel file, meaning that there are no clever or fancy formula or macros, just a collection of parts and part numbers gathered over MUCH time surfing various web sites. Any help or advise (beside the obvious....

Setting up a Form to be able to print
I have set up a form so as there are two pages (one after the other) on the form. When i view the first page of the form in Print Preview - there are two pages that i am able to print. However, when i print it out, only the "first page" of the Form prints. Any suggestions as to find out how to be able to print both pages of the form? You might try saving the form as a report, then adjusting the margins. Right-click on the form's name in the database window and choose: Save As then change the dropdown in the dialog to Report. -- Arvin Meyer, MCP, MVP http://www.datastr...

Set of Dialogs -Delete Any Dialog at Runtime-Organize Pos
Hai I Have set of Dialogs created a Runtime and those are placed sequentially in a postion by using SetWindowPos and now i want to delete a Dialog using close button associated with that Dialog which is placed at a Position the Dialog Order shoulnd rearrange automatically and is there any way to do that Thanks and Regards Mike SetWindowPos. Uusually if you have a set of dialogs there is an application window of some sort associated with the application. What I would do is have the dialog's close handler post a message indicating the dialog had closed, then...

CPropertySheet create failing when adding to dialog box
Hi all, I am having problems with a class that I made that inherits from CPropertySheet. I need to add this class to a dialog box with the following code: m_appPropSheet.AddPage(m_saleIllustrationPropPageClientOne); m_appPropSheet.AddPage(m_saleIllustrationPropPageClientTwo); m_appPropSheet.Create(this, WS_CHILD | WS_VISIBLE, 0); m_appPropSheet.EnableStackedTabs(FALSE); m_appPropSheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT); m_appPropSheet->ModifyStyle(0, WS_TABSTOP); m_appPropSheet.SetWindowPos(NULL, 0, 25, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); ...

OWA session Timeout (Form Based Auth )
Wondering if it is possible in Exchange 2003 SP2 to have different OWA timeout for different users using the same OWA HTTP VS to connect... If not, can a second HTTP VS on the same server as the first have different timeout, or is it a server setting ( I think it is done trough OWA web admin tool ) !!! Thanks !!! ...

Help building a filter on a form
Okay, I downloaded the Issue database template and simplified it greatly. Now, I can't get the "search issues" form to work. I have the following controls on my search form: Application (dropdown list) TextSearch (text field) I'd like to modify the existing code so that when I make an entry and click the "search" button, it will make the form footer visible (where the "browse_all_issues" form is imbedded as a subform). That part works. But, the next lines set the filter and turn it on... Me.FormFooter.Visible = True DoCmd.Mo...