Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Multiple records

Discussion in 'Information Technology' started by Jawad, Nov 10, 2005.

  1. Jawad

    Jawad
    Expand Collapse
    Guest

    If I change the "Enter Key Behavior" for a textbox used in a form to "New
    line in field", will each line be saved in a separate record?

    If not, how can I do it? Do I need a code?

    Thanks,
     
  2. Loading...


  3. Ofer

    Ofer
    Expand Collapse
    Guest

    No, Usually when you press the Enter key, it will move to the next field, so
    if you want the enter key to start a new line in the same text box, and in
    the same records, you need to make the changes that you just specified

    So, by pressing the enter key it will move to the next field, until it gets
    to the last field in the TAB order, and then it will jump to a new record

    Now, the question is, when do you want to move to a new record?

    You can do it with this line of code
    DoCmd.GoToRecord , "", acNewRec


    --
    The next line is only relevant to Microsoft''s web-based interface users.
    If I answered your question, please mark it as an answer. It''s useful to
    know that my answer was helpful
    HTH, good luck


    "Jawad" wrote:

    > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > line in field", will each line be saved in a separate record?
    >
    > If not, how can I do it? Do I need a code?
    >
    > Thanks,
     
  4. Jawad

    Jawad
    Expand Collapse
    Guest

    I want to move to a new record every time I hit the "Enter" key.
    In other words, I want each line in the text box to be stored in a separate
    record.

    What do I do?

    "Ofer" wrote:

    > No, Usually when you press the Enter key, it will move to the next field, so
    > if you want the enter key to start a new line in the same text box, and in
    > the same records, you need to make the changes that you just specified
    >
    > So, by pressing the enter key it will move to the next field, until it gets
    > to the last field in the TAB order, and then it will jump to a new record
    >
    > Now, the question is, when do you want to move to a new record?
    >
    > You can do it with this line of code
    > DoCmd.GoToRecord , "", acNewRec
    >
    >
    > --
    > The next line is only relevant to Microsoft''s web-based interface users.
    > If I answered your question, please mark it as an answer. It''s useful to
    > know that my answer was helpful
    > HTH, good luck
    >
    >
    > "Jawad" wrote:
    >
    > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > line in field", will each line be saved in a separate record?
    > >
    > > If not, how can I do it? Do I need a code?
    > >
    > > Thanks,
     
  5. Ofer

    Ofer
    Expand Collapse
    Guest

    If there is only one field in the form, then you dont need to do anything,
    unless you changed the setting of EnterKeyBehavior, then change it back to
    Default

    If there are more fields in the form, but you want to move to a new record
    every time you press enter in a certain field, then make sure that this field
    is last in the Tab Order.


    "Jawad" wrote:

    > I want to move to a new record every time I hit the "Enter" key.
    > In other words, I want each line in the text box to be stored in a separate
    > record.
    >
    > What do I do?
    >
    > "Ofer" wrote:
    >
    > > No, Usually when you press the Enter key, it will move to the next field, so
    > > if you want the enter key to start a new line in the same text box, and in
    > > the same records, you need to make the changes that you just specified
    > >
    > > So, by pressing the enter key it will move to the next field, until it gets
    > > to the last field in the TAB order, and then it will jump to a new record
    > >
    > > Now, the question is, when do you want to move to a new record?
    > >
    > > You can do it with this line of code
    > > DoCmd.GoToRecord , "", acNewRec
    > >
    > >
    > > --
    > > The next line is only relevant to Microsoft''s web-based interface users.
    > > If I answered your question, please mark it as an answer. It''s useful to
    > > know that my answer was helpful
    > > HTH, good luck
    > >
    > >
    > > "Jawad" wrote:
    > >
    > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > line in field", will each line be saved in a separate record?
    > > >
    > > > If not, how can I do it? Do I need a code?
    > > >
    > > > Thanks,
     
  6. Jawad

    Jawad
    Expand Collapse
    Guest

    There are more than one fields in the form and there are command buttons as
    well, so when I hit the enter key it does open a new record, but it moves to
    the next object in the form (in my case a command button). How can I keep the
    mouse pointer in the text box? Changing the "Enter key behavior" to “New line
    in field†is not creating a new record for me.

    Any thoughts?

    "Ofer" wrote:

    > If there is only one field in the form, then you dont need to do anything,
    > unless you changed the setting of EnterKeyBehavior, then change it back to
    > Default
    >
    > If there are more fields in the form, but you want to move to a new record
    > every time you press enter in a certain field, then make sure that this field
    > is last in the Tab Order.
    >
    >
    > "Jawad" wrote:
    >
    > > I want to move to a new record every time I hit the "Enter" key.
    > > In other words, I want each line in the text box to be stored in a separate
    > > record.
    > >
    > > What do I do?
    > >
    > > "Ofer" wrote:
    > >
    > > > No, Usually when you press the Enter key, it will move to the next field, so
    > > > if you want the enter key to start a new line in the same text box, and in
    > > > the same records, you need to make the changes that you just specified
    > > >
    > > > So, by pressing the enter key it will move to the next field, until it gets
    > > > to the last field in the TAB order, and then it will jump to a new record
    > > >
    > > > Now, the question is, when do you want to move to a new record?
    > > >
    > > > You can do it with this line of code
    > > > DoCmd.GoToRecord , "", acNewRec
    > > >
    > > >
    > > > --
    > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > know that my answer was helpful
    > > > HTH, good luck
    > > >
    > > >
    > > > "Jawad" wrote:
    > > >
    > > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > > line in field", will each line be saved in a separate record?
    > > > >
    > > > > If not, how can I do it? Do I need a code?
    > > > >
    > > > > Thanks,
     
  7. Ofer

    Ofer
    Expand Collapse
    Guest

    When you say that you want to add another record in that text box, do you
    want to add only in that text box, or in all the fields in the form.

    If you want to add only to that text box few records, it sound like a case
    for a sub form that handles this text box with another table, that has a one
    to many relationship to the original table.

    If you want to add a new record, and then stay in the same field, all the
    other fields will be empty, and most chances, that you'll get error of key
    violation.

    I need more details, so I can help you

    "Jawad" wrote:

    > There are more than one fields in the form and there are command buttons as
    > well, so when I hit the enter key it does open a new record, but it moves to
    > the next object in the form (in my case a command button). How can I keep the
    > mouse pointer in the text box? Changing the "Enter key behavior" to “New line
    > in field†is not creating a new record for me.
    >
    > Any thoughts?
    >
    > "Ofer" wrote:
    >
    > > If there is only one field in the form, then you dont need to do anything,
    > > unless you changed the setting of EnterKeyBehavior, then change it back to
    > > Default
    > >
    > > If there are more fields in the form, but you want to move to a new record
    > > every time you press enter in a certain field, then make sure that this field
    > > is last in the Tab Order.
    > >
    > >
    > > "Jawad" wrote:
    > >
    > > > I want to move to a new record every time I hit the "Enter" key.
    > > > In other words, I want each line in the text box to be stored in a separate
    > > > record.
    > > >
    > > > What do I do?
    > > >
    > > > "Ofer" wrote:
    > > >
    > > > > No, Usually when you press the Enter key, it will move to the next field, so
    > > > > if you want the enter key to start a new line in the same text box, and in
    > > > > the same records, you need to make the changes that you just specified
    > > > >
    > > > > So, by pressing the enter key it will move to the next field, until it gets
    > > > > to the last field in the TAB order, and then it will jump to a new record
    > > > >
    > > > > Now, the question is, when do you want to move to a new record?
    > > > >
    > > > > You can do it with this line of code
    > > > > DoCmd.GoToRecord , "", acNewRec
    > > > >
    > > > >
    > > > > --
    > > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > > know that my answer was helpful
    > > > > HTH, good luck
    > > > >
    > > > >
    > > > > "Jawad" wrote:
    > > > >
    > > > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > > > line in field", will each line be saved in a separate record?
    > > > > >
    > > > > > If not, how can I do it? Do I need a code?
    > > > > >
    > > > > > Thanks,
     
  8. Jawad

    Jawad
    Expand Collapse
    Guest

    Yes, I want to add new records only to one text box. Let me explain exactly
    what I have...

    1. I created a table called "Stock count" with two fields: "AWB number" and
    "Date".

    2. For this table I created a form for the users to enter the data. I called
    it "Stock count_frm".

    3. The form has two text boxes and two command buttons.
    a. The command buttons are irrelevant now, ignore them.
    b. The text boxes on the other hand are important; one text box is set to
    capture the date and store it in its proper field "Date" located in the
    "Stock count" table, and the other text box is used to enter the "AWB number"
    and store it in its proper field in the "Stock count" table.

    4. The problem is that I have too many AWB numbers to enter each day, and I
    don't want the users to enter them manually; to avoid human error. I want
    them to "copy" the AWB numbers from their source (Excel sheet), and "paste"
    them directly in the text box. Of course this way each AWB number will be on
    a separate line.

    5. When I changed the "Enter Key Behavior" for the text box to “New Line in
    Fieldâ€, I was able to "copy" and "paste" easily (each AWB number was on a
    separate line in the text box). The problem was that each AWB number (i.e.
    each line) was not stored in a separate record in the corresponding table
    (Stock count). And when I close the form page, I get this message: "The value
    you entered isn't valid for this field"

    What can I do??


    "Ofer" wrote:

    > When you say that you want to add another record in that text box, do you
    > want to add only in that text box, or in all the fields in the form.
    >
    > If you want to add only to that text box few records, it sound like a case
    > for a sub form that handles this text box with another table, that has a one
    > to many relationship to the original table.
    >
    > If you want to add a new record, and then stay in the same field, all the
    > other fields will be empty, and most chances, that you'll get error of key
    > violation.
    >
    > I need more details, so I can help you
    >
    > "Jawad" wrote:
    >
    > > There are more than one fields in the form and there are command buttons as
    > > well, so when I hit the enter key it does open a new record, but it moves to
    > > the next object in the form (in my case a command button). How can I keep the
    > > mouse pointer in the text box? Changing the "Enter key behavior" to “New line
    > > in field†is not creating a new record for me.
    > >
    > > Any thoughts?
    > >
    > > "Ofer" wrote:
    > >
    > > > If there is only one field in the form, then you dont need to do anything,
    > > > unless you changed the setting of EnterKeyBehavior, then change it back to
    > > > Default
    > > >
    > > > If there are more fields in the form, but you want to move to a new record
    > > > every time you press enter in a certain field, then make sure that this field
    > > > is last in the Tab Order.
    > > >
    > > >
    > > > "Jawad" wrote:
    > > >
    > > > > I want to move to a new record every time I hit the "Enter" key.
    > > > > In other words, I want each line in the text box to be stored in a separate
    > > > > record.
    > > > >
    > > > > What do I do?
    > > > >
    > > > > "Ofer" wrote:
    > > > >
    > > > > > No, Usually when you press the Enter key, it will move to the next field, so
    > > > > > if you want the enter key to start a new line in the same text box, and in
    > > > > > the same records, you need to make the changes that you just specified
    > > > > >
    > > > > > So, by pressing the enter key it will move to the next field, until it gets
    > > > > > to the last field in the TAB order, and then it will jump to a new record
    > > > > >
    > > > > > Now, the question is, when do you want to move to a new record?
    > > > > >
    > > > > > You can do it with this line of code
    > > > > > DoCmd.GoToRecord , "", acNewRec
    > > > > >
    > > > > >
    > > > > > --
    > > > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > > > know that my answer was helpful
    > > > > > HTH, good luck
    > > > > >
    > > > > >
    > > > > > "Jawad" wrote:
    > > > > >
    > > > > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > > > > line in field", will each line be saved in a separate record?
    > > > > > >
    > > > > > > If not, how can I do it? Do I need a code?
    > > > > > >
    > > > > > > Thanks,
     
  9. Ofer

    Ofer
    Expand Collapse
    Guest

    In that case changed the setting of EnterKeyBehavior back to Default

    And set the TabStop property of all the controls in the form, except of the
    AWB field, to No.

    That way every time you press enter it should jump to the next record

    --
    The next line is only relevant to Microsoft''s web-based interface users.
    If I answered your question, please mark it as an answer. It''s useful to
    know that my answer was helpful
    HTH, good luck


    "Jawad" wrote:

    > Yes, I want to add new records only to one text box. Let me explain exactly
    > what I have...
    >
    > 1. I created a table called "Stock count" with two fields: "AWB number" and
    > "Date".
    >
    > 2. For this table I created a form for the users to enter the data. I called
    > it "Stock count_frm".
    >
    > 3. The form has two text boxes and two command buttons.
    > a. The command buttons are irrelevant now, ignore them.
    > b. The text boxes on the other hand are important; one text box is set to
    > capture the date and store it in its proper field "Date" located in the
    > "Stock count" table, and the other text box is used to enter the "AWB number"
    > and store it in its proper field in the "Stock count" table.
    >
    > 4. The problem is that I have too many AWB numbers to enter each day, and I
    > don't want the users to enter them manually; to avoid human error. I want
    > them to "copy" the AWB numbers from their source (Excel sheet), and "paste"
    > them directly in the text box. Of course this way each AWB number will be on
    > a separate line.
    >
    > 5. When I changed the "Enter Key Behavior" for the text box to “New Line in
    > Fieldâ€, I was able to "copy" and "paste" easily (each AWB number was on a
    > separate line in the text box). The problem was that each AWB number (i.e.
    > each line) was not stored in a separate record in the corresponding table
    > (Stock count). And when I close the form page, I get this message: "The value
    > you entered isn't valid for this field"
    >
    > What can I do??
    >
    >
    > "Ofer" wrote:
    >
    > > When you say that you want to add another record in that text box, do you
    > > want to add only in that text box, or in all the fields in the form.
    > >
    > > If you want to add only to that text box few records, it sound like a case
    > > for a sub form that handles this text box with another table, that has a one
    > > to many relationship to the original table.
    > >
    > > If you want to add a new record, and then stay in the same field, all the
    > > other fields will be empty, and most chances, that you'll get error of key
    > > violation.
    > >
    > > I need more details, so I can help you
    > >
    > > "Jawad" wrote:
    > >
    > > > There are more than one fields in the form and there are command buttons as
    > > > well, so when I hit the enter key it does open a new record, but it moves to
    > > > the next object in the form (in my case a command button). How can I keep the
    > > > mouse pointer in the text box? Changing the "Enter key behavior" to “New line
    > > > in field†is not creating a new record for me.
    > > >
    > > > Any thoughts?
    > > >
    > > > "Ofer" wrote:
    > > >
    > > > > If there is only one field in the form, then you dont need to do anything,
    > > > > unless you changed the setting of EnterKeyBehavior, then change it back to
    > > > > Default
    > > > >
    > > > > If there are more fields in the form, but you want to move to a new record
    > > > > every time you press enter in a certain field, then make sure that this field
    > > > > is last in the Tab Order.
    > > > >
    > > > >
    > > > > "Jawad" wrote:
    > > > >
    > > > > > I want to move to a new record every time I hit the "Enter" key.
    > > > > > In other words, I want each line in the text box to be stored in a separate
    > > > > > record.
    > > > > >
    > > > > > What do I do?
    > > > > >
    > > > > > "Ofer" wrote:
    > > > > >
    > > > > > > No, Usually when you press the Enter key, it will move to the next field, so
    > > > > > > if you want the enter key to start a new line in the same text box, and in
    > > > > > > the same records, you need to make the changes that you just specified
    > > > > > >
    > > > > > > So, by pressing the enter key it will move to the next field, until it gets
    > > > > > > to the last field in the TAB order, and then it will jump to a new record
    > > > > > >
    > > > > > > Now, the question is, when do you want to move to a new record?
    > > > > > >
    > > > > > > You can do it with this line of code
    > > > > > > DoCmd.GoToRecord , "", acNewRec
    > > > > > >
    > > > > > >
    > > > > > > --
    > > > > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > > > > know that my answer was helpful
    > > > > > > HTH, good luck
    > > > > > >
    > > > > > >
    > > > > > > "Jawad" wrote:
    > > > > > >
    > > > > > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > > > > > line in field", will each line be saved in a separate record?
    > > > > > > >
    > > > > > > > If not, how can I do it? Do I need a code?
    > > > > > > >
    > > > > > > > Thanks,
     
  10. Jawad

    Jawad
    Expand Collapse
    Guest

    I did that, and it worked. But in this way I'll have to enter one AWB number
    at a time! And this won't exactly be practical; I have so many numbers. I
    need a way to enter all the AWB numbers at the same time, while still storing
    each one on a separate record.

    I still can't understand why the "Enter key behavior" does not work when I
    set it to "New Line in Field"... and what about the message I get, what does
    it mean?

    Can you help me?


    "Ofer" wrote:

    > In that case changed the setting of EnterKeyBehavior back to Default
    >
    > And set the TabStop property of all the controls in the form, except of the
    > AWB field, to No.
    >
    > That way every time you press enter it should jump to the next record
    >
    > --
    > The next line is only relevant to Microsoft''s web-based interface users.
    > If I answered your question, please mark it as an answer. It''s useful to
    > know that my answer was helpful
    > HTH, good luck
    >
    >
    > "Jawad" wrote:
    >
    > > Yes, I want to add new records only to one text box. Let me explain exactly
    > > what I have...
    > >
    > > 1. I created a table called "Stock count" with two fields: "AWB number" and
    > > "Date".
    > >
    > > 2. For this table I created a form for the users to enter the data. I called
    > > it "Stock count_frm".
    > >
    > > 3. The form has two text boxes and two command buttons.
    > > a. The command buttons are irrelevant now, ignore them.
    > > b. The text boxes on the other hand are important; one text box is set to
    > > capture the date and store it in its proper field "Date" located in the
    > > "Stock count" table, and the other text box is used to enter the "AWB number"
    > > and store it in its proper field in the "Stock count" table.
    > >
    > > 4. The problem is that I have too many AWB numbers to enter each day, and I
    > > don't want the users to enter them manually; to avoid human error. I want
    > > them to "copy" the AWB numbers from their source (Excel sheet), and "paste"
    > > them directly in the text box. Of course this way each AWB number will be on
    > > a separate line.
    > >
    > > 5. When I changed the "Enter Key Behavior" for the text box to “New Line in
    > > Fieldâ€, I was able to "copy" and "paste" easily (each AWB number was on a
    > > separate line in the text box). The problem was that each AWB number (i.e.
    > > each line) was not stored in a separate record in the corresponding table
    > > (Stock count). And when I close the form page, I get this message: "The value
    > > you entered isn't valid for this field"
    > >
    > > What can I do??
    > >
    > >
    > > "Ofer" wrote:
    > >
    > > > When you say that you want to add another record in that text box, do you
    > > > want to add only in that text box, or in all the fields in the form.
    > > >
    > > > If you want to add only to that text box few records, it sound like a case
    > > > for a sub form that handles this text box with another table, that has a one
    > > > to many relationship to the original table.
    > > >
    > > > If you want to add a new record, and then stay in the same field, all the
    > > > other fields will be empty, and most chances, that you'll get error of key
    > > > violation.
    > > >
    > > > I need more details, so I can help you
    > > >
    > > > "Jawad" wrote:
    > > >
    > > > > There are more than one fields in the form and there are command buttons as
    > > > > well, so when I hit the enter key it does open a new record, but it moves to
    > > > > the next object in the form (in my case a command button). How can I keep the
    > > > > mouse pointer in the text box? Changing the "Enter key behavior" to “New line
    > > > > in field†is not creating a new record for me.
    > > > >
    > > > > Any thoughts?
    > > > >
    > > > > "Ofer" wrote:
    > > > >
    > > > > > If there is only one field in the form, then you dont need to do anything,
    > > > > > unless you changed the setting of EnterKeyBehavior, then change it back to
    > > > > > Default
    > > > > >
    > > > > > If there are more fields in the form, but you want to move to a new record
    > > > > > every time you press enter in a certain field, then make sure that this field
    > > > > > is last in the Tab Order.
    > > > > >
    > > > > >
    > > > > > "Jawad" wrote:
    > > > > >
    > > > > > > I want to move to a new record every time I hit the "Enter" key.
    > > > > > > In other words, I want each line in the text box to be stored in a separate
    > > > > > > record.
    > > > > > >
    > > > > > > What do I do?
    > > > > > >
    > > > > > > "Ofer" wrote:
    > > > > > >
    > > > > > > > No, Usually when you press the Enter key, it will move to the next field, so
    > > > > > > > if you want the enter key to start a new line in the same text box, and in
    > > > > > > > the same records, you need to make the changes that you just specified
    > > > > > > >
    > > > > > > > So, by pressing the enter key it will move to the next field, until it gets
    > > > > > > > to the last field in the TAB order, and then it will jump to a new record
    > > > > > > >
    > > > > > > > Now, the question is, when do you want to move to a new record?
    > > > > > > >
    > > > > > > > You can do it with this line of code
    > > > > > > > DoCmd.GoToRecord , "", acNewRec
    > > > > > > >
    > > > > > > >
    > > > > > > > --
    > > > > > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > > > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > > > > > know that my answer was helpful
    > > > > > > > HTH, good luck
    > > > > > > >
    > > > > > > >
    > > > > > > > "Jawad" wrote:
    > > > > > > >
    > > > > > > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > > > > > > line in field", will each line be saved in a separate record?
    > > > > > > > >
    > > > > > > > > If not, how can I do it? Do I need a code?
    > > > > > > > >
    > > > > > > > > Thanks,
     
  11. Ofer

    Ofer
    Expand Collapse
    Guest

    As I explained in the first post the Enter key behavior will change it in a
    way that every time you press the Enter key it will strart a new line in the
    same field and not in the different records.

    Sorry
    --
    The next line is only relevant to Microsoft''s web-based interface users.
    If I answered your question, please mark it as an answer. It''s useful to
    know that my answer was helpful
    HTH, good luck


    "Jawad" wrote:

    > I did that, and it worked. But in this way I'll have to enter one AWB number
    > at a time! And this won't exactly be practical; I have so many numbers. I
    > need a way to enter all the AWB numbers at the same time, while still storing
    > each one on a separate record.
    >
    > I still can't understand why the "Enter key behavior" does not work when I
    > set it to "New Line in Field"... and what about the message I get, what does
    > it mean?
    >
    > Can you help me?
    >
    >
    > "Ofer" wrote:
    >
    > > In that case changed the setting of EnterKeyBehavior back to Default
    > >
    > > And set the TabStop property of all the controls in the form, except of the
    > > AWB field, to No.
    > >
    > > That way every time you press enter it should jump to the next record
    > >
    > > --
    > > The next line is only relevant to Microsoft''s web-based interface users.
    > > If I answered your question, please mark it as an answer. It''s useful to
    > > know that my answer was helpful
    > > HTH, good luck
    > >
    > >
    > > "Jawad" wrote:
    > >
    > > > Yes, I want to add new records only to one text box. Let me explain exactly
    > > > what I have...
    > > >
    > > > 1. I created a table called "Stock count" with two fields: "AWB number" and
    > > > "Date".
    > > >
    > > > 2. For this table I created a form for the users to enter the data. I called
    > > > it "Stock count_frm".
    > > >
    > > > 3. The form has two text boxes and two command buttons.
    > > > a. The command buttons are irrelevant now, ignore them.
    > > > b. The text boxes on the other hand are important; one text box is set to
    > > > capture the date and store it in its proper field "Date" located in the
    > > > "Stock count" table, and the other text box is used to enter the "AWB number"
    > > > and store it in its proper field in the "Stock count" table.
    > > >
    > > > 4. The problem is that I have too many AWB numbers to enter each day, and I
    > > > don't want the users to enter them manually; to avoid human error. I want
    > > > them to "copy" the AWB numbers from their source (Excel sheet), and "paste"
    > > > them directly in the text box. Of course this way each AWB number will be on
    > > > a separate line.
    > > >
    > > > 5. When I changed the "Enter Key Behavior" for the text box to “New Line in
    > > > Fieldâ€, I was able to "copy" and "paste" easily (each AWB number was on a
    > > > separate line in the text box). The problem was that each AWB number (i.e.
    > > > each line) was not stored in a separate record in the corresponding table
    > > > (Stock count). And when I close the form page, I get this message: "The value
    > > > you entered isn't valid for this field"
    > > >
    > > > What can I do??
    > > >
    > > >
    > > > "Ofer" wrote:
    > > >
    > > > > When you say that you want to add another record in that text box, do you
    > > > > want to add only in that text box, or in all the fields in the form.
    > > > >
    > > > > If you want to add only to that text box few records, it sound like a case
    > > > > for a sub form that handles this text box with another table, that has a one
    > > > > to many relationship to the original table.
    > > > >
    > > > > If you want to add a new record, and then stay in the same field, all the
    > > > > other fields will be empty, and most chances, that you'll get error of key
    > > > > violation.
    > > > >
    > > > > I need more details, so I can help you
    > > > >
    > > > > "Jawad" wrote:
    > > > >
    > > > > > There are more than one fields in the form and there are command buttons as
    > > > > > well, so when I hit the enter key it does open a new record, but it moves to
    > > > > > the next object in the form (in my case a command button). How can I keep the
    > > > > > mouse pointer in the text box? Changing the "Enter key behavior" to “New line
    > > > > > in field†is not creating a new record for me.
    > > > > >
    > > > > > Any thoughts?
    > > > > >
    > > > > > "Ofer" wrote:
    > > > > >
    > > > > > > If there is only one field in the form, then you dont need to do anything,
    > > > > > > unless you changed the setting of EnterKeyBehavior, then change it back to
    > > > > > > Default
    > > > > > >
    > > > > > > If there are more fields in the form, but you want to move to a new record
    > > > > > > every time you press enter in a certain field, then make sure that this field
    > > > > > > is last in the Tab Order.
    > > > > > >
    > > > > > >
    > > > > > > "Jawad" wrote:
    > > > > > >
    > > > > > > > I want to move to a new record every time I hit the "Enter" key.
    > > > > > > > In other words, I want each line in the text box to be stored in a separate
    > > > > > > > record.
    > > > > > > >
    > > > > > > > What do I do?
    > > > > > > >
    > > > > > > > "Ofer" wrote:
    > > > > > > >
    > > > > > > > > No, Usually when you press the Enter key, it will move to the next field, so
    > > > > > > > > if you want the enter key to start a new line in the same text box, and in
    > > > > > > > > the same records, you need to make the changes that you just specified
    > > > > > > > >
    > > > > > > > > So, by pressing the enter key it will move to the next field, until it gets
    > > > > > > > > to the last field in the TAB order, and then it will jump to a new record
    > > > > > > > >
    > > > > > > > > Now, the question is, when do you want to move to a new record?
    > > > > > > > >
    > > > > > > > > You can do it with this line of code
    > > > > > > > > DoCmd.GoToRecord , "", acNewRec
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > --
    > > > > > > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > > > > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > > > > > > know that my answer was helpful
    > > > > > > > > HTH, good luck
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > "Jawad" wrote:
    > > > > > > > >
    > > > > > > > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > > > > > > > line in field", will each line be saved in a separate record?
    > > > > > > > > >
    > > > > > > > > > If not, how can I do it? Do I need a code?
    > > > > > > > > >
    > > > > > > > > > Thanks,
     
  12. Jawad

    Jawad
    Expand Collapse
    Guest

    I see, thanks anyway.

    "Ofer" wrote:

    > As I explained in the first post the Enter key behavior will change it in a
    > way that every time you press the Enter key it will strart a new line in the
    > same field and not in the different records.
    >
    > Sorry
    > --
    > The next line is only relevant to Microsoft''s web-based interface users.
    > If I answered your question, please mark it as an answer. It''s useful to
    > know that my answer was helpful
    > HTH, good luck
    >
    >
    > "Jawad" wrote:
    >
    > > I did that, and it worked. But in this way I'll have to enter one AWB number
    > > at a time! And this won't exactly be practical; I have so many numbers. I
    > > need a way to enter all the AWB numbers at the same time, while still storing
    > > each one on a separate record.
    > >
    > > I still can't understand why the "Enter key behavior" does not work when I
    > > set it to "New Line in Field"... and what about the message I get, what does
    > > it mean?
    > >
    > > Can you help me?
    > >
    > >
    > > "Ofer" wrote:
    > >
    > > > In that case changed the setting of EnterKeyBehavior back to Default
    > > >
    > > > And set the TabStop property of all the controls in the form, except of the
    > > > AWB field, to No.
    > > >
    > > > That way every time you press enter it should jump to the next record
    > > >
    > > > --
    > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > know that my answer was helpful
    > > > HTH, good luck
    > > >
    > > >
    > > > "Jawad" wrote:
    > > >
    > > > > Yes, I want to add new records only to one text box. Let me explain exactly
    > > > > what I have...
    > > > >
    > > > > 1. I created a table called "Stock count" with two fields: "AWB number" and
    > > > > "Date".
    > > > >
    > > > > 2. For this table I created a form for the users to enter the data. I called
    > > > > it "Stock count_frm".
    > > > >
    > > > > 3. The form has two text boxes and two command buttons.
    > > > > a. The command buttons are irrelevant now, ignore them.
    > > > > b. The text boxes on the other hand are important; one text box is set to
    > > > > capture the date and store it in its proper field "Date" located in the
    > > > > "Stock count" table, and the other text box is used to enter the "AWB number"
    > > > > and store it in its proper field in the "Stock count" table.
    > > > >
    > > > > 4. The problem is that I have too many AWB numbers to enter each day, and I
    > > > > don't want the users to enter them manually; to avoid human error. I want
    > > > > them to "copy" the AWB numbers from their source (Excel sheet), and "paste"
    > > > > them directly in the text box. Of course this way each AWB number will be on
    > > > > a separate line.
    > > > >
    > > > > 5. When I changed the "Enter Key Behavior" for the text box to “New Line in
    > > > > Fieldâ€, I was able to "copy" and "paste" easily (each AWB number was on a
    > > > > separate line in the text box). The problem was that each AWB number (i.e.
    > > > > each line) was not stored in a separate record in the corresponding table
    > > > > (Stock count). And when I close the form page, I get this message: "The value
    > > > > you entered isn't valid for this field"
    > > > >
    > > > > What can I do??
    > > > >
    > > > >
    > > > > "Ofer" wrote:
    > > > >
    > > > > > When you say that you want to add another record in that text box, do you
    > > > > > want to add only in that text box, or in all the fields in the form.
    > > > > >
    > > > > > If you want to add only to that text box few records, it sound like a case
    > > > > > for a sub form that handles this text box with another table, that has a one
    > > > > > to many relationship to the original table.
    > > > > >
    > > > > > If you want to add a new record, and then stay in the same field, all the
    > > > > > other fields will be empty, and most chances, that you'll get error of key
    > > > > > violation.
    > > > > >
    > > > > > I need more details, so I can help you
    > > > > >
    > > > > > "Jawad" wrote:
    > > > > >
    > > > > > > There are more than one fields in the form and there are command buttons as
    > > > > > > well, so when I hit the enter key it does open a new record, but it moves to
    > > > > > > the next object in the form (in my case a command button). How can I keep the
    > > > > > > mouse pointer in the text box? Changing the "Enter key behavior" to “New line
    > > > > > > in field†is not creating a new record for me.
    > > > > > >
    > > > > > > Any thoughts?
    > > > > > >
    > > > > > > "Ofer" wrote:
    > > > > > >
    > > > > > > > If there is only one field in the form, then you dont need to do anything,
    > > > > > > > unless you changed the setting of EnterKeyBehavior, then change it back to
    > > > > > > > Default
    > > > > > > >
    > > > > > > > If there are more fields in the form, but you want to move to a new record
    > > > > > > > every time you press enter in a certain field, then make sure that this field
    > > > > > > > is last in the Tab Order.
    > > > > > > >
    > > > > > > >
    > > > > > > > "Jawad" wrote:
    > > > > > > >
    > > > > > > > > I want to move to a new record every time I hit the "Enter" key.
    > > > > > > > > In other words, I want each line in the text box to be stored in a separate
    > > > > > > > > record.
    > > > > > > > >
    > > > > > > > > What do I do?
    > > > > > > > >
    > > > > > > > > "Ofer" wrote:
    > > > > > > > >
    > > > > > > > > > No, Usually when you press the Enter key, it will move to the next field, so
    > > > > > > > > > if you want the enter key to start a new line in the same text box, and in
    > > > > > > > > > the same records, you need to make the changes that you just specified
    > > > > > > > > >
    > > > > > > > > > So, by pressing the enter key it will move to the next field, until it gets
    > > > > > > > > > to the last field in the TAB order, and then it will jump to a new record
    > > > > > > > > >
    > > > > > > > > > Now, the question is, when do you want to move to a new record?
    > > > > > > > > >
    > > > > > > > > > You can do it with this line of code
    > > > > > > > > > DoCmd.GoToRecord , "", acNewRec
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > > --
    > > > > > > > > > The next line is only relevant to Microsoft''s web-based interface users.
    > > > > > > > > > If I answered your question, please mark it as an answer. It''s useful to
    > > > > > > > > > know that my answer was helpful
    > > > > > > > > > HTH, good luck
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > > "Jawad" wrote:
    > > > > > > > > >
    > > > > > > > > > > If I change the "Enter Key Behavior" for a textbox used in a form to "New
    > > > > > > > > > > line in field", will each line be saved in a separate record?
    > > > > > > > > > >
    > > > > > > > > > > If not, how can I do it? Do I need a code?
    > > > > > > > > > >
    > > > > > > > > > > Thanks,
     

Share This Page