Results 1 to 6 of 6
  1. #1
    craig1988 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2014
    Posts
    82

    Append Values to a query using a form

    Hi



    This seems so simple but I cannot figure out what is going wrong.

    I have a for "FImportUI". It has a textbox and a list box. In the properties, I have given them meaningful names "DateInput" and "TimeInput".

    I have an append query that I would like to append the values of the form above to columns of the destination table.

    So in my query I have the following:

    Field: Expr1: "Date"
    Table:
    Sort:
    Criteria: [Forms]![FImportUI]![DateInput]

    This is the same for the list box (with the name appropriately changed to [TimeInput]).

    I am running the query through a command button so I enter the values into the form FImportUI and click the button to run the append query but it tells me it is going to append 0 Rows (There is data to be appended for sure).

    Can anyone suggest what might be wrong with this set up??

    Thanks in advance.

    Craig

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If you're saying you want the value on the form appended into the table, the form reference would be in the Field argument, not the criteria. I would also expect there to be an Append To line designating the target field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    craig1988 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2014
    Posts
    82
    I Have made those changes but still no luck.

    The query now reads like this

    Field: Expr1: [Forms]![FImportUI]![DateInput]
    Table:
    Sort:
    Append To: SheetDate
    Criteria:
    Or:


    Field: Expr1: [Forms]![FImportUI]![TimeInput]
    Table:
    Sort:
    Append To: SheetTime
    Criteria:
    Or:

    Could this be a formatting issue because they are dates and times?

    Thanks

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I'd expect an error because of the duplicate alias (Expr1). If you change the second to Expr2 does it work? If not, can you post the db here? I've appended dates from a form before, so I don't think that's the problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    craig1988 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2014
    Posts
    82
    Damn copy and paste...

    I did have the second one as Expr2. Also, for some weird reason, I deleted the query and rebuilt it and it worked fine.

    Apologies for the time wasting.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No worries, glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Split form on append query
    By OneToLearn in forum Queries
    Replies: 1
    Last Post: 04-16-2012, 11:20 PM
  2. Replies: 3
    Last Post: 03-15-2012, 02:11 PM
  3. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  4. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  5. Query Table Values in Append Query
    By AKQTS in forum Queries
    Replies: 5
    Last Post: 11-12-2010, 03:58 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