Page 15 of 16 FirstFirst ... 5678910111213141516 LastLast
Results 211 to 225 of 233
  1. #211
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    But isn't OldValue null, so why doesn't it like it (in your IF statement)?



    That was because I'd copied it from the DeleteRow button... so should that be changed to null too?
    Don't understand?

  2. #212
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    If oldvalue isn't null, it's fine - it's if it is null that the problem occurs.
    I haven't tried the code I pasted in #208 yet... I think it should work, but not sure.
    Also, since I'm deleting the row in that case, surely it makes no difference as to if the other fields' data is 'undone'

  3. #213
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Test it then let me know.

  4. #214
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Yeah, that works

    I think there's just one more query... Like I said, I want to the heading to have a logo which will take the user back to the homepage. To save me having to enter the code each time (and change it on each form if something needs changing), I've tried to put it in the module. However, the code I've tried (below) is rejected because it doesn't like the way I've referenced the Homepage, what am I doing wrong? I've included reports because I will be adding them at some point in the future, they're just not necessary for the database to go live.

    Code:
    Public Function ReturnHome()
    Do While Forms.Count > 0
    DoCmd.Close acForm, Forms(0).Name
    Loop
    Do While Reports.Count > 0
    DoCmd.Close acReport, Reports(0).Name
    Loop
    DoCmd.OpenForm Homepage
    End Function
    Oh, and does the rest of my code need work - code removing etc? I've attached the database so you've got an up to date version.
    Attached Files Attached Files

  5. #215
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Form name needs to be in quotes!

    Good thinking on this, great job.

  6. #216
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Damn, so close! I had a little help from the internet

    Ok, so that just leaves improving the code... I think. Have you noticed anything that's wrong/too long winded/is repeated too much?

    Or is there anything I haven't thought of? I know you mentioned ensuring data validation is done on the data, is this now covered?

  7. #217
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Give me some time on this. Off the top of my head: fields on the tables, are they still 255 long? Do you all your Back buttons work?

  8. #218
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    I'm pretty sure all the back buttons work and the text fields are restricted as much as possible (allowing for some error on my part - not anticipating how long a login could be for instance)

  9. #219
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Bit late to think of it now - but for your Behaviours you don't need those three subforms, one will suffice. You could set the record source in the load of Behaviours, then make any changes in the code of the subform if/when required. Should have thought of this sooner!

    Your code is behaving well. The line-ups are awful, of course, making it very hard to read - but you already know that. No comments either. What is going to happen is that you will put this database down and a year later you will need to make a change and will have forgotten everything! The more you can do now to make it easier for yourself later on the better.

    I always add as much in the code too - instead of "BehaviourID" I will write Me!BehaviourID - making it immediately obvious what I am referring to. Also I "Call" all my functions, instead of just the one work "AssessorUpdate" I write "Call AssessorUpdate", again making it patently obvious what is going on. Sort of like documentation in the code.

    You have come a long way and done a good job.

  10. #220
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Bit late to think of it now - but for your Behaviours you don't need those three subforms, one will suffice. You could set the record source in the load of Behaviours, then make any changes in the code of the subform if/when required. Should have thought of this sooner!
    I haven't come that far, I haven't a clue what any of that means or how it would work :')

    Yes, I'll go through and tidy it up when I get a minute. I'm not sure what you mean with calling the functions though... does that need to be in the name or just where I'm calling it?

  11. #221
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Just as I wrote it, sending the code to a function/subroutine is termed "calling" a f/sub.

  12. #222
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Seems too simple... but yeah, seems to work! Thanks for all your help, I imagine it won't be long before I'm back asking for more help... It's been a while since I created reports.

  13. #223
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Good luck!

  14. #224
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This will solve that problem.

  15. #225
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    This is the latest version

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

Similar Threads

  1. Replies: 13
    Last Post: 04-21-2016, 03:33 AM
  2. Macro to Open Form Triggers Exclusive Access Message
    By snakatsu in forum Database Design
    Replies: 5
    Last Post: 11-10-2015, 10:46 PM
  3. Replies: 6
    Last Post: 09-30-2015, 03:14 PM
  4. Multiple options based on a tree structure...
    By blue22 in forum Database Design
    Replies: 3
    Last Post: 01-09-2014, 05:58 AM
  5. Replies: 1
    Last Post: 08-01-2011, 04:17 PM

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