ncbeachbum
New member
- Local time
- Yesterday, 21:27
- Joined
- Jul 12, 2015
- Messages
- 4
We have a ton of Access 97 DBs I've been asked to "fix". Since moving to Windows 7 some of them have been giving Error70 comands, which I've narrowed down to Sendkey not playing nicely with Windows 7. Anyway, I was able to fix it for one user by turning UAC off. Not my preferred way to operate, but it's a stopgap until I can get this mess sorted out.
Ok, here's the code. This is an event procedure that is tied to a date field where staff are to enter a date in MM/DD/YYYY format. For some reason there is no tab order anywhere on this DB so they have to click to enter. In the past they had to make sure that they clicked at the left most M in MM to make the entry.
It appears that this Sendkey is the culprit here. Is there anyway I can safely remove that w/o breaking something? I cannot get sole access to this DB as it's in use pretty much 24/7 until the 11pm backup for the server it resides on. It is Access 97. I was thinking of just pulling the macro from that field but then again I am not an Access person by any means, just someone asked to try and fix it while they hunt for a replacement (the DBA who had been here left on short notice).
[FONT="] Option Compare Database[/FONT]
[FONT="] Option Explicit[/FONT]
[FONT="] [/FONT]
[FONT="] Private Sub cboxptno_GotFocus()[/FONT]
[FONT="] cboxptno.Dropdown[/FONT]
[FONT="] End Sub[/FONT]
[FONT="] ----[/FONT]
[FONT="] Private Sub Command111_Click()[/FONT]
[FONT="] On Error GoTo Err_Command111_Click[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] DoCmd.Close[/FONT]
[FONT="] [/FONT]
[FONT="] Exit_Command111_Click:[/FONT]
[FONT="] Exit Sub[/FONT]
[FONT="] ---[/FONT]
[FONT="] Err_Command111_Click:[/FONT]
[FONT="] MsgBox Err.Description[/FONT]
[FONT="] Resume Exit_Command111_Click[/FONT]
[FONT="] [/FONT]
[FONT="] End Sub[/FONT]
[FONT="] ---[/FONT]
[FONT="] Private Sub needdate_Click()[/FONT]
[FONT="] Dim intWait As Integer[/FONT]
[FONT="] Dim intCount As Integer[/FONT]
[FONT="] If IsNull(Me![needdate]) Then[/FONT]
[FONT="] SendKeys "{Home}"[/FONT]
[FONT="] Else[/FONT]
[FONT="] intWait = 1000[/FONT]
[FONT="] For intCount = 1 To intWait[/FONT]
[FONT="] DoEvents[/FONT]
[FONT="] Next[/FONT]
[FONT="] SendKeys "{Home}"[/FONT]
[FONT="] End If[/FONT]
[FONT="] End Sub[/FONT]
[FONT="] ----[/FONT]
[FONT="] Private Sub reqdate_BeforeUpdate(Cancel As Integer)[/FONT]
[FONT="] [/FONT]
[FONT="] End Sub[/FONT]
Ok, here's the code. This is an event procedure that is tied to a date field where staff are to enter a date in MM/DD/YYYY format. For some reason there is no tab order anywhere on this DB so they have to click to enter. In the past they had to make sure that they clicked at the left most M in MM to make the entry.
It appears that this Sendkey is the culprit here. Is there anyway I can safely remove that w/o breaking something? I cannot get sole access to this DB as it's in use pretty much 24/7 until the 11pm backup for the server it resides on. It is Access 97. I was thinking of just pulling the macro from that field but then again I am not an Access person by any means, just someone asked to try and fix it while they hunt for a replacement (the DBA who had been here left on short notice).
[FONT="] Option Compare Database[/FONT]
[FONT="] Option Explicit[/FONT]
[FONT="] [/FONT]
[FONT="] Private Sub cboxptno_GotFocus()[/FONT]
[FONT="] cboxptno.Dropdown[/FONT]
[FONT="] End Sub[/FONT]
[FONT="] ----[/FONT]
[FONT="] Private Sub Command111_Click()[/FONT]
[FONT="] On Error GoTo Err_Command111_Click[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] DoCmd.Close[/FONT]
[FONT="] [/FONT]
[FONT="] Exit_Command111_Click:[/FONT]
[FONT="] Exit Sub[/FONT]
[FONT="] ---[/FONT]
[FONT="] Err_Command111_Click:[/FONT]
[FONT="] MsgBox Err.Description[/FONT]
[FONT="] Resume Exit_Command111_Click[/FONT]
[FONT="] [/FONT]
[FONT="] End Sub[/FONT]
[FONT="] ---[/FONT]
[FONT="] Private Sub needdate_Click()[/FONT]
[FONT="] Dim intWait As Integer[/FONT]
[FONT="] Dim intCount As Integer[/FONT]
[FONT="] If IsNull(Me![needdate]) Then[/FONT]
[FONT="] SendKeys "{Home}"[/FONT]
[FONT="] Else[/FONT]
[FONT="] intWait = 1000[/FONT]
[FONT="] For intCount = 1 To intWait[/FONT]
[FONT="] DoEvents[/FONT]
[FONT="] Next[/FONT]
[FONT="] SendKeys "{Home}"[/FONT]
[FONT="] End If[/FONT]
[FONT="] End Sub[/FONT]
[FONT="] ----[/FONT]
[FONT="] Private Sub reqdate_BeforeUpdate(Cancel As Integer)[/FONT]
[FONT="] [/FONT]
[FONT="] End Sub[/FONT]