Results 1 to 3 of 3
  1. #1
    RoundTrip is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    28

    A If statement? When boxes are checked it does a action, and also giving copies to ot


    Hello all! Thankyou in advance for the help I will be recieving hopefully! I have just a few questions! First off, I am wondering how to set up a database in access to make it where you can not open it in design view or layout view, just regular ol Form view so others can only enter information and not edit anything by accident on the forms and other things.

    + Also I am needing to know another thing, or perhaps A good way of going about of doing this
    I have a checkbox or a yes/no box, I have two fields in a table, one called Replant which is the yes/no field type, and ReasonWhy which is a text field. I want to know how if in a form someone clicks on the replant checkbox for yes, then a tiny popup screen pops up asking you to enter a quick brief description of why it needs to be replanted, if that is possible without to much trouble, i would like to know how to go about doing this
    Thankyou everyone!

  2. #2
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Hi there,

    There are modules on the net that disable the use of the shift key on startup. Effectively that disables the design view.
    I think the module is called AllowBypassKey.

    There is a "but" to it though. When the database is copied into another Db then someone can access it.
    I made a custom login system that begins when i open my main form. The shift key is by default disabled so even i cant open it the first time.
    In a corner of the form i made a secret button wich isnt visible unless you know where it is.
    When clicked by the right computer and user (use module FOSuserName and FOSComputername for this) i can enter a password, if the password is correct i can set the database in a design mode by clicking a checkmark.
    After doing that i can go in design mode untill i uncheck it again.

    When users log in, their login is logged by the system in a table i made.

    Last and not least ive made the database "non-replicable" so someone cant copy the database !
    Im pretty sure a hacker can disable my security measures. But is not as easy as it looks :P

    As for users not enabling to edit records, its dead easy. You can make the table read only. Or you can give them permissions depending on who logs in. There are build in ways to do that, and custom ways.

  3. #3
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    There are modules on the net that disable the use of the shift key on startup. Effectively that disables the design view. I think the module is called AllowBypassKey.
    As well as the above you can disable the menus and system keys

    firstly paste this into a blank DB, it's used to turn back on the menus, controls (run this to restore your access menu, controls) set the statup form to your form name, or place in an autoexec macro.

    Private Sub Form_Open(Cancel As Integer)
    DoCmd.Restore
    Application.CommandBars.ActiveMenuBar.Enabled = True
    Application.RefreshTitleBar
    fActivateControlBox (True)
    DoCmd.RunCommand acCmdExit
    End Sub

    This will turn them off (be caurfull, perhaps put the above on a command button were you can get at it to restore the current menus, controls. delete it when you finished design)

    DoCmd.Maximize
    On Error Resume Next
    fActivateControlBox (False)
    Application.RefreshTitleBar
    Application.CommandBars.ActiveMenuBar.Enabled = False


    Also handle incoming ctrl and alt keys to stop closing DB

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim intCtrlDown As Integer, intAltDown As Integer, intShiftDown As Integer
    intAltDown = (Shift And acAltMask) > 0
    intCtrlDown = (Shift And acCtrlMask) > 0
    If intCtrlDown Then
    If KeyCode = vbKeyF4 Then
    KeyCode = 0
    Else
    Exit Sub
    End If
    End If
    If intAltDown Then
    If KeyCode = vbKeyF4 Then
    KeyCode = 0
    Else
    Exit Sub
    End If
    End If
    End Sub



    This will handle the second question

    Private Sub Replant_AfterUpdate()
    me.ReasonWhy =InputBox(" Enter a brief reason for replanting please." & vbCrLf & vbCrLf & vbCrLf & " Bonsai ")
    End Sub

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

Similar Threads

  1. If...Then type statement for combo boxes in table
    By whitneynf08 in forum Access
    Replies: 3
    Last Post: 09-11-2013, 02:56 PM
  2. Checked Box + Date = Checked box
    By ItsATJ in forum Access
    Replies: 12
    Last Post: 09-03-2013, 10:25 AM
  3. Replies: 54
    Last Post: 07-17-2013, 03:01 PM
  4. Using Check boxes for an if statement
    By brow1726 in forum Forms
    Replies: 3
    Last Post: 06-10-2013, 09:50 PM
  5. sql statement with 3 combo boxes
    By benjammin in forum Queries
    Replies: 4
    Last Post: 06-09-2011, 12:22 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