Results 1 to 8 of 8
  1. #1
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159

    Append todays date based on a where condition into a table

    I need to append a date into a field based on certain criteria.

    Any input would be great.

  2. #2
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    Firstly, its hard to give help for a specific thing, without specifics....

    Are you trying to:

    1. Update existing entries

    2. Create (append) new entries from another souce and add todays date along with it?

    3. Something else

    We need to know you table structure, and your desired effect, and any objects you are trying to do it specifically with.

    For instance

    Tbl_ex

    Ex_Id, Prod_name, Prod_Price

    which is bound to a form Frm_test and I am trying to update all records with a Price lower than £2 to be £2 when I press a command button.

    It doesn't have to be overly detailed, but there has to be enough details for us to have an idea what exactly you are trying to achieve.

  3. #3
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    Okay Sorry again!!

    Basically I have an unbound form called frmCheckback where there is an unbound combo with a list of boxes. There is a button on this form which I want to use to checkback files depending on what box is selected. This will run off the box id.

    I have a table called file_checkout with the following fields:

    checkoutid (pk)
    fileid (fk)
    box_id(fk)
    file_out
    checkout_date
    checkback_date

    and a table called box

    box_id
    box_no

    and file

    file_id (pk)
    box_id(fk)

    file checkout is related to file and is on the many side of a one to many relationship.

    I already have checkout_date in via a form

  4. #4
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    You can use an update query with fixed criteria.
    Take a look at:
    http://office.microsoft.com/en-us/access-help/update-data-by-using-a-query-HA010076527.aspx

  5. #5
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    actually yeah, a simple update query might do it..........

    cheers...........

  6. #6
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    Where do these grading systems come from?

    Suddenly I'm an 'advanced beginner' wow!

    NOt feeling very advanced today ;-)

  7. #7
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    Anyone any idea what may be wrong with this? I keep getting an error message saying that the database engine cannot find the table or query........

    Dim mySQL As String


    mySQL = mySQL & " UPDATE su_file_checkout.checkback_date SET su_file_checkout.checkback_date = #" & Date & "# "
    mySQL = mySQL & " WHERE su_file.box_id = su_box_location.box_ID AND su_box_location.box_ID=" & Me.cboBox & ""
    mySQL = mySQL & " AND su_file.checkback_date is null "


    CurrentDb.Execute mySQL, dbFailOnError

  8. #8
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    hey.....thanks........got there eventually with your suggestion...........should of stayed in bed today I think!

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

Similar Threads

  1. Replies: 4
    Last Post: 02-28-2012, 05:26 PM
  2. Replies: 1
    Last Post: 12-12-2011, 06:32 AM
  3. Replies: 2
    Last Post: 07-07-2011, 08:25 AM
  4. Replies: 1
    Last Post: 11-04-2010, 12:57 PM
  5. Adding todays date
    By EDEd in forum Forms
    Replies: 2
    Last Post: 10-08-2010, 06:27 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