Ahh yes, the always absent "other guy" who mangled up the thing in the first place. If they ever catch that guy there will be a lynch mob banging on the jailhouse door.The code for this application was written over 10 years ago by someone long since retired. The suggestions offered by Xipooo, ItsMe, and ssanfu are very helpful and I'm trying, but to the novice, looking at someone else's work seem like trying to untangle some seriously messed up fishing line. In the mean time, I've come up w/ a workaround by taking an existing working form (the sign-out form) and peeling away everything I can until I arrive at something close to the sign-in form (that doesn't work). Comparing the two is also helping me understand some of what's going, but it's a process. Thanks for the help and I'll keep gnawing at it.
Well, in his defense, how many Access apps with over 100 users written 10+ years ago are still working strong. You and I wouldn't be having this conversation if he (or anyone else that knew how to fix it) were within arms reach. As much as I'd love to solve this riddle, my biggest fear is someone will notice that I f#@ked something up like 'Oh, you have the CapsLock on. In my case (at work anyway) it's 'In the land of the blind, the one-eyed man is king.'
If you want to provide db for analysis, follow instructions at bottom of my post.
The only thing unusual I see in the code is using Text property. Why Text? Value is the default property for data controls and doesn't have to be typed.
Don't think I've ever used Text property.
Don't understand need for the timer in Load event.
I also always name controls different from the fields.
I have successfully set Value of field and control in Open event. Examples:
Me!Remark1 = "See attached one dimensional consolidation Report."
Me.cbxLabNum = Me.OpenArgs
But could try Current event instead of Open.
Maybe the form is corrupted. I see you are trying to rebuild. Any luck?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
That's the part of your reply I understood.
The rest not so much.
If you're good with it, I'll try to take you up on your offer.
Also, feel free to correct whatever annoys you.
I'll try to get it to you tomorrow.
Thanks.![]()
This is the application minus any irrelevant data, but including all the application elements. I think there are probably several objects, forms, or scripts, or what have you that have no function, but I'm reluctant to delete or modify anything I don't fully understand which is kind of all of it. Thanks for looking under the hood and I'm here all day.
I took a working form and tried to pull out everything that wasn't necessary or distracting and the 'new' form now allows me edit the appropriate fields that were being automatically zeroed out by the now non-working form, but it's quite a bit less elegant than the way the earlier form had worked when it all that was required was entering the employee ID and it did the rest. I have attached the DB in my earlier post, but it was Friday and may have gone unnoticed. Thanks for looking.
Here is what I did.
1. rename the SignInForm to SignInFormOLD or just delete it now instead of later
2. copy the SignOutForm and name the copy to SignInForm
3. eliminate unneeded controls from the new SignInForm, and fix the InOut textbox (probably easiest to delete and create new one)
4. delete the Enter Time and Enter Date buttons and their code from the new form
5. delete the ExtRetDate_BeforeUpdate procedure from the new form
6. delete irrelevant code from the Close button procedure of the new form and fix code
DoCmd.Close acForm, "SignInForm", acSaveNo
7. delete the extended absence label from the footer
8. Modify the Open event code of the new form. It is not necessary to set focus to a control just to populate it by code. Your code is setting textboxes to empty string ("") but the table is set to not allow empty (zero length) strings into the table. Set the fields to Null instead of "". Why are these fields being set to empty anyway?
Code:Private Sub Form_Open(Cancel As Integer) On Error GoTo Form_Open_Err Dim Message, Title As String Message = "Enter your caseload number." Title = "Set Filter for SignOut Screen." AgentNumber = InputBox(Message, Title) Me.Filter = "[AgentNum] = '" & AgentNumber & "'" Me.FilterOn = True InOut = "In" Notes = Null Notes.SetFocus Exit_Form_Open: Exit Sub Form_Open_Err: MsgBox "Error, " & Err.Description & " You entered a number that does not exist" Me.Undo DoCmd.Close acForm, "SignOutForm", acSaveNo Exit Sub End Sub
BTW, recommend no spaces or special characters/punctuation (underscore is exception) in naming convention.
Last edited by June7; 02-25-2014 at 12:47 AM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks for working through it. I'm unable to do anything with it tonight as I'm on a 64-bit at home which seems to piss it off. I will be making the adjustments tomorrow a work if I can and get back w/ you then. Thanks again.