Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set field property in a new record (Access 2000)

    I want to set a field property of a new record depending on a previous property.I wonder how can i do it.In my example i have a table orders.When i open a new record in the following case :
    Private Sub Form_Open(Cancel As Integer)
    DoCmd.GoToRecord , , acNewRec
    customerid.SetFocus
    i want the next record to have the field property Audit set to yes and to delete the previous field having this property.In the example i am sending, this field is order number 5803. Its field Audit is set to Yes.Therefore the next record should be with Audit = Yes and also to delete the order number 5803.
    Can you help me ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Set field property in a new record (Access 2000)

    You don't need the Audit field in the Orders table since it is calculated and since it cannot be changed by the user.
    So:
    1) Open the Orders table in design view and delete Audit. Then save the table.
    2) Open Query1 in design view and add a calculated column:

    Audit: [OrderID]=(SELECT Max(OrderID) FROM Orders)

    Save the query.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set field property in a new record (Access 2000)

    Thank you for your reply.I have to preserve the field because it is used for other actions.But you are right, i have to give up this approach

Posting Permissions

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