Professional Web Applications Themes

Enter Key behavior - Microsoft Access

I have a form that our receptionists use to enter a reporting probationers name. This name will then show up on a probationer officers desktop in an access form filtered for that particular agent. When the form comes up for the receptionist, she enters the agents 4 digit agent code and then goes to the next field to enter the reporting probationers name. All goes ok if she tabs to the next field. However, if the enter key is pressed at any time, it closes the form and does not save the entry. This has caused some confusion. I have ...

  1. #1

    Default Enter Key behavior

    I have a form that our receptionists use to enter a
    reporting probationers name. This name will then show up
    on a probationer officers desktop in an access form
    filtered for that particular agent. When the form comes
    up for the receptionist, she enters the agents 4 digit
    agent code and then goes to the next field to enter the
    reporting probationers name. All goes ok if she tabs to
    the next field. However, if the enter key is pressed at
    any time, it closes the form and does not save the entry.
    This has caused some confusion. I have the Keyboard
    option set in Options to go to the next field and in all
    my other forms is works as expected. The one difference
    in this form is it also has a subform on it. The subform
    has only one field (the agent name). There is a
    relationship between the reporting table and the agent
    table. The agent table has the agents code and their name
    and the reporting table only has the agent code. I put
    the subform with the name field in the form so that the
    receptionist will see the name of the offender to confirm
    that she put the agent code in for the proper agent. I am
    a newcomer to Access as previously in programmed in
    ObjectPal. There are a lot of things I like about Access
    but the data model in Paradox made it much easier to add
    fields from seperate tables without creating subforms.
    Could somebody tell me how to correct the Enter key
    behavior for this form? I strongly suspect it is the
    subform that is causing the problem since my other forms
    work OK. Or alternatively, is there a way to put fields
    from other tables on a form without putting a subform on
    the form? Thanks in advance for your help.
    Al Westerlund Guest

  2. #2

    Default Enter Key Behaviour

    Hi

    what are your property settings in the 'Other' tab under
    Enter Key Behaviour ??? this could be the cause.

    Regards
    >-----Original Message-----
    >I have a form that our receptionists use to enter a
    >reporting probationers name. This name will then show up
    >on a probationer officers desktop in an access form
    >filtered for that particular agent. When the form comes
    >up for the receptionist, she enters the agents 4 digit
    >agent code and then goes to the next field to enter the
    >reporting probationers name. All goes ok if she tabs to
    >the next field. However, if the enter key is pressed at
    >any time, it closes the form and does not save the
    entry.
    >This has caused some confusion. I have the Keyboard
    >option set in Options to go to the next field and in all
    >my other forms is works as expected. The one difference
    >in this form is it also has a subform on it. The subform
    >has only one field (the agent name). There is a
    >relationship between the reporting table and the agent
    >table. The agent table has the agents code and their
    name
    >and the reporting table only has the agent code. I put
    >the subform with the name field in the form so that the
    >receptionist will see the name of the offender to confirm
    >that she put the agent code in for the proper agent. I
    am
    >a newcomer to Access as previously in programmed in
    >ObjectPal. There are a lot of things I like about Access
    >but the data model in Paradox made it much easier to add
    >fields from seperate tables without creating subforms.
    >Could somebody tell me how to correct the Enter key
    >behavior for this form? I strongly suspect it is the
    >subform that is causing the problem since my other forms
    >work OK. Or alternatively, is there a way to put fields
    >from other tables on a form without putting a subform on
    >the form? Thanks in advance for your help.
    >.
    >
    craig Guest

  3. #3

    Default Enter Key behavior

    Is there any kind of 'Close' button on your form? If so,
    check the properties of the control. Its 'Default'
    property should be set to 'No'.

    If a form contains any command button with the 'Default'
    property set to 'yes', it will execute the OnClick() event
    of that button when the enter key is pressed. I hope its
    this simple. Good luck.
    >-----Original Message-----
    >I have a form that our receptionists use to enter a
    >reporting probationers name. This name will then show up
    >on a probationer officers desktop in an access form
    >filtered for that particular agent. When the form comes
    >up for the receptionist, she enters the agents 4 digit
    >agent code and then goes to the next field to enter the
    >reporting probationers name. All goes ok if she tabs to
    >the next field. However, if the enter key is pressed at
    >any time, it closes the form and does not save the
    entry.
    >This has caused some confusion. I have the Keyboard
    >option set in Options to go to the next field and in all
    >my other forms is works as expected. The one difference
    >in this form is it also has a subform on it. The subform
    >has only one field (the agent name). There is a
    >relationship between the reporting table and the agent
    >table. The agent table has the agents code and their
    name
    >and the reporting table only has the agent code. I put
    >the subform with the name field in the form so that the
    >receptionist will see the name of the offender to confirm
    >that she put the agent code in for the proper agent. I
    am
    >a newcomer to Access as previously in programmed in
    >ObjectPal. There are a lot of things I like about Access
    >but the data model in Paradox made it much easier to add
    >fields from seperate tables without creating subforms.
    >Could somebody tell me how to correct the Enter key
    >behavior for this form? I strongly suspect it is the
    >subform that is causing the problem since my other forms
    >work OK. Or alternatively, is there a way to put fields
    >from other tables on a form without putting a subform on
    >the form? Thanks in advance for your help.
    >.
    >
    Elwin Guest

  4. #4

    Default Re: Enter Key behavior

    If you have any button like a ok button, or a cancel button on the form,
    check the property setting.

    There is a option in the "other" tab called "default". If any command button
    on your form has this set to "Yes", then hitting the Enter key will fire
    that button.

    You can also make any button get pressed via the Esc key. If you set the
    command button "cancel" to "yes", then the Esc key fill fire the button.

    so, check any of your command buttons. (and, keep in mind, that for dialog
    boxes, and other types of forms, you might want the Enter key to fire a
    button for you..so that "default" option can be useful).

    Now, for your other problem:

    You have a LOT of possibility here. I think for just ONE field that you need
    to display from that other file, you can droop the whole sub-form and use a
    dlookup.


    Just place a text box on the screen, and use:

    =(dlookup("offeder Field","agentTable","id = " & agentCode))

    Now, the above is a bit of hand full of a expression. You could also base
    the form on a query, and with that query simply join in that other lookup
    value. This would save you the messy dlookup command.

    I mean, using a whole sub form just to lookup a value is a bit much.
    Further, the sub form really is useful for a one to "many" relational. For
    just looking up values, you should use a combo box, or the above dlookup.

    Note that you can use the wizard to make the combo box. In fact, try placing
    two combo boxes on your form. Each combo box will be based on your "agent
    id" field, but you can have the combo display a differnt value. Often, we
    do use a combo box to lookup a value in the other tables.

    --
    Albert D. Kallal (MVP)
    Edmonton, Alberta Canada
    [email]kallalmsn.com[/email]
    [url]http://www.attcanada.net/~kallal.msn[/url]


    Albert D. Kallal Guest

  5. #5

    Default Re: Enter Key behavior

    Thanks a bunch! It was the default behavior that was the
    problem. I had the default behavior on the Cancel button
    set to Yes. I changed that to No and it solved the
    problem. It was No on the Save and close button and I
    changed that to Yes as I do want Enter to trigger that
    button. Definitely solved my problem.
    As to the other issue, I agree the subform is an unwieldy
    way to do a lookup. It was also a pain to do it that way.
    I am new to Access and am learning my way. I don't really
    want to go the query route but I will look into how to do
    the Combo box. I don't really know how to do that but I
    will research it before looking for help here. I will
    also look at the dlookup method. With the subform there
    is a slight delay before the agent name shows. Perhaps
    the dlookup will go quicker. Again, thanks for your help.
    Al Westerlund
    >-----Original Message-----
    >If you have any button like a ok button, or a cancel
    button on the form,
    >check the property setting.
    >
    >There is a option in the "other" tab called "default". If
    any command button
    >on your form has this set to "Yes", then hitting the
    Enter key will fire
    >that button.
    >
    >You can also make any button get pressed via the Esc key.
    If you set the
    >command button "cancel" to "yes", then the Esc key fill
    fire the button.
    >
    >so, check any of your command buttons. (and, keep in
    mind, that for dialog
    >boxes, and other types of forms, you might want the Enter
    key to fire a
    >button for you..so that "default" option can be useful).
    >
    >Now, for your other problem:
    >
    >You have a LOT of possibility here. I think for just ONE
    field that you need
    >to display from that other file, you can droop the whole
    sub-form and use a
    >dlookup.
    >
    >
    >Just place a text box on the screen, and use:
    >
    >=(dlookup("offeder Field","agentTable","id = " &
    agentCode))
    >
    >Now, the above is a bit of hand full of a expression. You
    could also base
    >the form on a query, and with that query simply join in
    that other lookup
    >value. This would save you the messy dlookup command.
    >
    >I mean, using a whole sub form just to lookup a value is
    a bit much.
    >Further, the sub form really is useful for a one
    to "many" relational. For
    >just looking up values, you should use a combo box, or
    the above dlookup.
    >
    >Note that you can use the wizard to make the combo box.
    In fact, try placing
    >two combo boxes on your form. Each combo box will be
    based on your "agent
    >id" field, but you can have the combo display a differnt
    value. Often, we
    >do use a combo box to lookup a value in the other tables.
    >
    >--
    >Albert D. Kallal (MVP)
    >Edmonton, Alberta Canada
    >kallalmsn.com
    >[url]http://www.attcanada.net/~kallal.msn[/url]
    >
    >
    >.
    >
    Al Westerlund Guest

Similar Threads

  1. Enter key in datagrid
    By Stephen J. Shephard in forum ASP.NET Data Grid Control
    Replies: 3
    Last Post: April 28th, 02:05 AM
  2. Waiting for enter key
    By Dan Dan the Magic Man in forum Macromedia Director Basics
    Replies: 3
    Last Post: April 14th, 07:11 PM
  3. can I use enter as a tab?
    By F@bio in forum Macromedia Flash
    Replies: 0
    Last Post: October 28th, 04:15 PM
  4. Tab to Enter
    By Ruby in forum ASP.NET General
    Replies: 2
    Last Post: July 24th, 06:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139