Results 1 to 2 of 2

Thread: Comment Field

  1. #1
    Join Date
    Jun 2011
    Posts
    1

    Unanswered: Comment Field

    Hello all,

    I am not a pro in access, but do use it quite often. Here is what I am doing:

    I created two fields and one submit button.

    Field 1: Comment

    The user can input a comment up to 255 Characters then click the submit button.

    Field 2: Posted Comments

    I would like to have a running list of the comments from field 1 with a date/time stamp.

    I need help...thank you very much for your time.

  2. #2
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    You've got a couple of methods that you could do.

    The quickest way but the least astheticly pleasing would be to have a table showing all the comments so far. Including in your submit button would be a Me.List.Requery command.

    A better looking way would be to design a subform showing the comment and date, and place that into your form. Same thing as above, within your submit button have a Me.Subform.Requery button.

    The SQL behind both the table and subform method would look like

    SELECT TABLENAME.*
    FROM TABLENAME
    ORDER BY TABLENAME.FIELD2;

    *Assuming that Field2 is your date/time field.

    The code behind your submit button would look like;

    Code:
    Command_Click()
    
    DoCmd****nSQL "Insert Into TABLENAME (TEXT1, TEXT2) Values (TEXT1, Now());"
    ' Note the above should say DoCmd. RunSQL without the space but DBforums keeps removing it...
    
    
    'Me.SubformName.Requery
    'OR
    'Me.List.Requery
    
    Me.Text1 = ""
    Me.Text2 = ""
    
    End Sub
    Last edited by christyxo; 06-22-11 at 05:30.

Posting Permissions

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