Results 1 to 4 of 4
  1. #1
    NSKD is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    3

    How to input text from textbox onto table?

    Hi Guys,

    So sorry I am very new to access. I have a question and hope someone can help me along.

    I have a table with a field named 'Comments'. On the form, I would like to have a text input and a command button. After the user enter the comments onto the textbox and subsequently click on the command button, the comments will be input onto the 'Comments' field of the table.

    Q1. How can the text box be link to the 'Comments' field of the table?


    Q2. Only after I press the command button then the input text on the text box will be transfer to the table. What is the command for that?

    Thanks.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    This textbox can be 'linked' to a field same way as any other, by binding it to a field of form's RecordSource. If the table is not part of this form's RecordSource, then you probably need a form/subform arrangement.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    NSKD is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    3
    Quote Originally Posted by June7 View Post
    This textbox can be 'linked' to a field same way as any other, by binding it to a field of form's RecordSource. If the table is not part of this form's RecordSource, then you probably need a form/subform arrangement.
    Hi, I have link the text box to the field. But I wanted to also create a command button to save the input text onto the table. The command button should not save other input entries on other textbox. How should i go about doing it??

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    This question is essentially the same as presented in https://www.accessforums.net/showthr...command-button

    That thread suggested opening a recordset.

    However, you say the textbox is 'linked' to the field. This means bound. Any entry to a bound text, combo, list box is entered directly to table. The edits are committed when the form is closed, move to another record, or run code. Why do you need code to save? It would be: DoCmd.RunCommand acCmdSaveRecord

    If you don't want entries to controls to pass directly to table field, the controls must be unbound. As long are fields are still included in the form's RecordSource, save the value to field with button click is simply:

    Me!fieldname = Me.textboxname
    Last edited by June7; 03-12-2012 at 04:28 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 08-18-2011, 07:31 AM
  2. Input Value based on another textbox value
    By dude19 in forum Access
    Replies: 2
    Last Post: 06-30-2011, 03:48 PM
  3. Replies: 11
    Last Post: 06-02-2011, 10:21 AM
  4. Replies: 1
    Last Post: 11-07-2010, 11:04 AM
  5. Textbox will not allow input
    By cwf in forum Forms
    Replies: 0
    Last Post: 04-04-2008, 04:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums