Results 1 to 5 of 5
  1. #1
    banno1 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    5

    First attempt at basic coding!

    Hi again all.

    Thank you very much for all the help so far! Still struggling with making my database perfect - so close though!

    I am trying a bit of basic code. I don't want forms to be edited after they have been input unless a button that I have labeled 'edit' is pressed. I have got this to work but I want an exception to the editing block. I want two fields called "Booked" and "Appointment Date" to be free to edit until the "Booked" field has been ticked (it is a yes/no box).

    This is what I have so far....

    Private Sub cmdEdit_Click()
    Me.AllowEdits = True



    End Sub


    Private Sub Form_Current()
    If Me.NewRecord Then
    Me.AllowEdits = True
    Else
    Me.AllowEdits = False
    End If
    End Sub

    Any comments/tips/tricks on changing this code in line with the above request would be greatly appreciated!

    Thanks again

  2. #2
    banno1 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    5
    Update: Nooo! The above code was workings really well but I have just reloaded the database and now my subforms have disappeared off the form view, but are still visible in the design view. All new records are missing the subforms - any idea what has gone wrong?

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    any idea what has gone wrong?
    pure guesswork - you've opened the wrong database? You've removed recordsources from forms?

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Are the (new) records still in the table(s)?

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,412
    Maybe you should post your db here for us to look at.
    There are so many things that could possibly be wrong that it might take forever to straighten it out via message exchanges here.
    If we can see your DB we can get it working and make suggestions on how you might avoid noob mistakes.

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

Similar Threads

  1. Basic Coding Question - Novice
    By PinkLady50 in forum Access
    Replies: 8
    Last Post: 03-22-2018, 01:24 PM
  2. My First attempt at SQL
    By WhiskyLima in forum Misc
    Replies: 4
    Last Post: 04-08-2014, 09:54 AM
  3. Building my Own Collection(s) - Attempt #2!
    By Rawb in forum Programming
    Replies: 2
    Last Post: 12-18-2012, 08:25 AM
  4. Replies: 7
    Last Post: 08-10-2012, 03:09 PM
  5. Failed attempt at concetenation
    By snowboarder234 in forum Queries
    Replies: 2
    Last Post: 07-12-2012, 09:02 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