Results 1 to 3 of 3
  1. #1
    Guerra67 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    9

    Form not saving control property changes on save and close

    Here is the code:
    Private Sub CONTRACTREQchk_Click()
    Dim CResponse As Integer
    CResponse = MsgBox("Please confirm that you have REQUESTED the CONTRACT?", vbYesNo, "Continue")


    If CResponse = vbYes Then
    CONTRACTREQDATE = Now()
    CONTRACTREQEMP = CurrentUser
    CONTRACTREQchk.Value = True
    CONTRACT.BackColor = RGB(255, 255, 0)
    Me.CONTRACTREQDATE.Locked = True
    Me.CONTRACTREQEMP.Locked = True

    Else
    MsgBox "Please Return when you have the correct information", 0, "CONTRACT!"
    CONTRACTREQDATE = ""


    CONTRACTREQEMP = ""
    CONTRACT.Value = False
    Me.CONTRACTREQDATE.Locked = False
    Me.CONTRACTREQEMP.Locked = False
    End If


    End Sub

    When i click on the check box it changes the toggle button to yellow, however after i close and come back into the record the toggle button is back to the default blue. Also the text boxes COTRACTREQDATE and CONTRACTREQEMP are not locked.
    What am i missing

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    if you close the form, all settings revert to the original in design mode.

    maybe you want settings to change ON CURRENT event. each time you move to a record?

  3. #3
    Guerra67 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    9
    Thanks for the quick reply. However, this is still not working for me. Also, I can you explain why I should put it under a ON CURRENT instead of ON CLICK?
    I have placed the following code to ON LOAD.
    If CResponse = vbYes Then
    CONTRACTREQDATE = Now()
    CONTRACTREQEMP = CurrentUser
    CONTRACTREQchk.Value = True
    CONTRACT.BackColor = RGB(255, 255, 0)
    Me.CONTRACTREQDATE.Locked = True
    Me.CONTRACTREQEMP.Locked = True

    Else
    MsgBox "Please Return when you have the correct information", 0, "CONTRACT!"
    CONTRACTREQDATE = ""
    CONTRACTREQEMP = ""
    CONTRACT.Value = False
    Me.CONTRACTREQDATE.Locked = False
    Me.CONTRACTREQEMP.Locked = False
    End If

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

Similar Threads

  1. Can't save or close form
    By Buakaw in forum Forms
    Replies: 4
    Last Post: 07-26-2011, 04:47 AM
  2. Replies: 1
    Last Post: 07-22-2011, 02:48 PM
  3. Replies: 6
    Last Post: 04-13-2011, 03:55 PM
  4. form won't save and close
    By Philislost in forum Access
    Replies: 6
    Last Post: 10-08-2010, 01:47 PM
  5. Replies: 2
    Last Post: 01-29-2010, 11:33 AM

Tags for this Thread

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