Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Posts
    74

    Unanswered: prevention of edit forms/tables

    hi

    how do i prevent user from entering into the 'design view', 'datasheet view' of my form??? how can i prevent them for entering to the database window (where you can choose to create table in design view or wizard.)??

    pls advice
    nono

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Just look up StartupShowDBWindow
    Here is an Example

    Sub EinstellenStarteigenschaften()
    ÄndernEigenschaft "StartupForm", dbText, "Kunden"
    ÄndernEigenschaft "StartupShowDBWindow", dbBoolean, False
    ÄndernEigenschaft "StartupShowStatusBar", dbBoolean, False
    ÄndernEigenschaft "AllowBuiltinToolbars", dbBoolean, False
    ÄndernEigenschaft "AllowFullMenus", dbBoolean, True
    ÄndernEigenschaft "AllowBreakIntoCode", dbBoolean, False
    ÄndernEigenschaft "AllowSpecialKeys", dbBoolean, True

    ÄndernEigenschaft "AllowBypassKey", dbBoolean, True
    End Sub

    Function ÄndernEigenschaft(strEigenschaftenname As String, varEigenschaftentyp As Variant, varEigenschaftenwert As Variant) As Integer
    Dim dbs As Database, prp As Property
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Ändern_Fehler
    dbs.Properties(strEigenschaftenname) = varEigenschaftenwert
    ÄndernEigenschaft = True

    Ändern_Ende:
    Exit Function

    Ändern_Fehler:

    If Err = conPropNotFoundError Then ' Eigenschaft nicht gefunden.
    Set prp = dbs.CreateProperty(strEigenschaftenname, _
    varEigenschaftentyp, varEigenschaftenwert)
    dbs.Properties.Append prp
    Resume Next
    Else
    ' Unbekannter Fehler.
    ÄndernEigenschaft = False
    Resume Ändern_Ende
    End If
    End Function

  3. #3
    Join Date
    Nov 2003
    Posts
    74
    where do i place these code????
    and why is there some other languages text??? can u translate.

    pls advice
    nono

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by damnnono_86
    where do i place these code????
    and why is there some other languages text??? can u translate.

    pls advice
    nono
    You can put the function in any MODULE, but the sub you can copy it in the ClickEvent of any button.

    If put your courser on (AllowSpecialKeys ) and press F1 you will get this example in your ACCESS Language. I use a German version.

  5. #5
    Join Date
    Nov 2003
    Posts
    74
    what do u mean by :

    "You can put the function in any MODULE, but the sub you can copy it in the ClickEvent of any button."

    the function place in a NEW module???
    and click event, which click ??? please explain as i am not very good in vba.

    thanks
    nono

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by damnnono_86
    what do u mean by :

    "You can put the function in any MODULE, but the sub you can copy it in the ClickEvent of any button."

    the function place in a NEW module???
    and click event, which click ??? please explain as i am not very good in vba.

    thanks
    nono
    You can put the Function in a new Module, right.
    Make a Button on your Form, and in its Click Event you can call the Function like that:

    AendernEigenschaft "StartupForm", dbText, "Kunden"
    AendernEigenschaft "StartupShowDBWindow", dbBoolean, False
    AendernEigenschaft "StartupShowStatusBar", dbBoolean, False
    AendernEigenschaft "AllowBuiltinToolbars", dbBoolean, False
    AendernEigenschaft "AllowFullMenus", dbBoolean, True
    AendernEigenschaft "AllowBreakIntoCode", dbBoolean, False
    AendernEigenschaft "AllowSpecialKeys", dbBoolean, True

    Hope it's clear now.
    Have nice day


Posting Permissions

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