Results 1 to 4 of 4
  1. #1
    mitchy1111 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    9

    Wink Auto populate form fields based on another field

    Hi,

    I'm new to access. Getting around OK though. Some help would be much appreciated.

    I have a field on a form where I want to enter a date, I would then like another field to auto populate with that date plus say 90 days.



    I tried having a column in the query that the form is based on to have a default value of date field + 90 but it doesn't work.

    Cheers

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Default value of FieldB

    =DateAdd("d",90,FieldA)

    David

  3. #3
    mitchy1111 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    9
    Thanks for getting back so quick David. I can see how this function should do the trick but can't get it to work

    When I add the expression to the default value field and try to save, I get an error message: The database engine either does not recognise the field 'Date' or the default value in the table.

    I have double checked the field names

    Any further tips?

    Cheers

  4. #4
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Test 1

    Press Ctrl+G to enter the immediate window

    Type in

    ?DateAdd("d",90,Date())

    What does it give you?

    If the value is always going to be 90 days then you can use this calculation in your query, so there is no need to add a field to your table to hold a calculated date.

    David

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

Similar Threads

  1. Auto Populate Data from Main Form
    By billiejean in forum Forms
    Replies: 0
    Last Post: 08-05-2009, 08:08 AM
  2. Replies: 0
    Last Post: 06-23-2009, 03:01 PM
  3. Replies: 2
    Last Post: 05-22-2009, 01:07 PM
  4. Auto populate fields on a form
    By ldarley in forum Forms
    Replies: 0
    Last Post: 08-14-2008, 09:39 AM
  5. Replies: 1
    Last Post: 10-26-2007, 07:29 AM

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