Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Compatibility problem (MS Access 2007)

    in my databaseprogram in version Access 2.0 i used the following constants to define the formstate of my forms:

    Const EDTMODE_BROWSE = 0
    Const EDTMODE_EDIT = 1
    Const EDTMODE_ADD = 2
    Const EDTMODE_NOREC = 3

    Const DEFEDT_DATAENTRY = 1
    Const DEFEDT_ALLOWEDITS = 2
    Const DEFEDT_READONLY = 3
    Const DEFEDT_CANTADD = 4

    Are the numbers that used then still usable in MS Access2007 or do we have to use other statements to define the formstate in MS Access 2007?

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: Compatibility problem (MS Access 2007)

    Where do you use these constants?

  4. #3
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compatibility problem (MS Access 2007)

    I declare this constants in the declarationsection of my Form frmOrders.
    Then when e.g. i click the button 'New" on this form , a statement in the event Click calls the sub : Call Changeformstate(EDTMODE_ADD)
    and in this sub we have:

    Private Sub Changeformstate(intMode As Integer)

    On Error Resume Next
    Me(First_Control).SetFocus
    On Error GoTo ChangeFormStateErr

    Select Case intMode
    Case EDTMODE_NOREC
    Me!Standaardbewerking = 4
    Me.Caption = FORM_CAPTION & " (Geen huidige Record)"
    Case EDTMODE_BROWSE
    Me.DefaultEditing = DEFEDT_CANTADD
    Call pjTglVergrendeling(Me, SECTION_DETAIL, True)
    Me.Caption = "Raadplegen van een bestelling"
    Case EDTMODE_EDIT
    Me.DefaultEditing = DEFEDT_CANTADD
    Call pjTglVergrendeling(Me, SECTION_DETAIL, False)
    Me.Caption = "Wijzigen van een bestelling"
    Me(First_Control).SetFocus
    Call UnSelectCtlText
    Case EDTMODE_ADD
    Me.DefaultEditing = DEFEDT_DATAENTRY
    Call pjTglVergrendeling(Me, SECTION_DETAIL, False)
    Me.Caption = "Invoeren van een nieuwe bestelling"
    Me(First_Control).SetFocus
    End Select
    mintEditMode = intMode
    There the formstate is set and after that a sub is called to make the neccesary locking or unlocking of controls ( Call pjTglVergrendeling(Me, SECTION_DETAIL, False)

  5. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Compatibility problem (MS Access 2007)

    DefaultEditing is a hidden language element in Access 95 and later, meaning that it is still present for compatibility purposes, but it is not supported any more. The old MSKB article ACC: DefaultEditing Property Replaced in Microsoft Access 95 and 97 describes the properties that have replaced DefaultEditing. It applies to Access 2000, 2002, 2003 and 2007 too. I strongly recommend you to update your code to use the new properties.

  6. #5
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compatibility problem (MS Access 2007)

    Thank you very much !!!

  7. #6
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compatibility problem (MS Access 2007)

    I foolowed your advice and set the following properties of my form frmOrders and sfrmOrders in the property window:
    AllowEdits = No
    AllowDeletions = no
    AllowAdditions = Yes
    DataEntry = No

    When i open my form frmOrders together with subfrmOrders now I see the entered order of my client with ordernr 1.
    1) Is it possible to get the forms open without showing any entered order.
    2) Why the combination AllowAdditions and DataEntry , isn't Allowadditions not enough?

  8. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Compatibility problem (MS Access 2007)

    AllowAdditions lets you specify whether the user is allowed to create new records or not. You usually use this for a form in which the user can view existing records.

    If you set DataEntry to Yes, the form will only allow the user to create new records, not to view existing records. So I think that is what you want here.

Posting Permissions

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