From: accesskastle on 5 Apr 2010 22:08 Hi- I have two forms. One is a datasheet view, the other a single form view, of pretty much the same data. When a user double-clicks a field in the datasheet view, the idea is that it will go to the single form with tabs, allowing the user to see all the data in a much more user friendly display. However, the first time I click on the field, the form flashes continuously until I CTRL+ALT+DEL to start the Windows Task manager to break the process. Once I do this, everytime after, I don't experience the problem. I tried inserting Debug.Print statements to find out where it's going wrong, but it passes them all, with no error message: Private Sub Click_below_DblClick(Cancel As Integer) On Error GoTo Err_Click_below Debug.Print "Executing double-click..." RefreshAll Debug.Print "refreshed..." If Len(GISEventID) = 20 Then DoCmd.Echo False DoCmd.OpenForm "frmEventLogTab", acNormal, , "[EventID] = " & Forms!frmEventLog_tb!EventLogID Debug.Print "Opened tab form..." Forms!frmEventLog_tb.SetFocus Debug.Print "Setfocus..." DoCmd.Minimize DoCmd.Echo True 'Debug.Print "minimized...complete." Else MsgBox "Sorry! You must enter information before proceeding to tab view." Debug.Print "no info..." Cancel = True Debug.Print "cancel=true" End If Exit_Click_below: Exit Sub Err_Click_below: MsgBox Err.Number & " " & Err.Description End Sub Anyone got any ideas how to stop this problem?
From: Dirk Goldgar on 6 Apr 2010 13:06 "accesskastle" <accesskastle(a)discussions.microsoft.com> wrote in message news:048D0057-F66B-44A8-85A5-8EAFD7E63CB4(a)microsoft.com... > Hi- > > I have two forms. One is a datasheet view, the other a single form view, > of > pretty much the same data. When a user double-clicks a field in the > datasheet view, the idea is that it will go to the single form with tabs, > allowing the user to see all the data in a much more user friendly > display. > > However, the first time I click on the field, Click, or double-click? > the form flashes continuously > until I CTRL+ALT+DEL to start the Windows Task manager to break the > process. > Once I do this, everytime after, I don't experience the problem. > > I tried inserting Debug.Print statements to find out where it's going > wrong, > but it passes them all, with no error message: > > > Private Sub Click_below_DblClick(Cancel As Integer) > On Error GoTo Err_Click_below > > Debug.Print "Executing double-click..." > RefreshAll > Debug.Print "refreshed..." > If Len(GISEventID) = 20 Then > DoCmd.Echo False > DoCmd.OpenForm "frmEventLogTab", acNormal, , "[EventID] = " & > Forms!frmEventLog_tb!EventLogID > Debug.Print "Opened tab form..." > Forms!frmEventLog_tb.SetFocus > Debug.Print "Setfocus..." > DoCmd.Minimize > DoCmd.Echo True > 'Debug.Print "minimized...complete." > Else > MsgBox "Sorry! You must enter information before proceeding to tab > view." > Debug.Print "no info..." > Cancel = True > Debug.Print "cancel=true" > End If > > Exit_Click_below: > Exit Sub > > Err_Click_below: > MsgBox Err.Number & " " & Err.Description > End Sub Why are you setting Echo off? Is it just to avoid minimizing the wrong form? I don't know, but I wonder if there's a problem involved in the combination of SetFocus and Echo = False. What happens if you do this: '------ start of suggested code snippet ----- If Len(GISEventID) = 20 Then DoCmd.Minimize DoEvents DoCmd.OpenForm "frmEventLogTab", acNormal, , _ "[EventID] = " & Forms!frmEventLog_tb!EventLogID Debug.Print "Opened tab form..." '------ end of suggested code snippet ----- Is there code in the Open, Load, or Current events of frmEventLogTab that might be relevant? -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup)
From: accesskastle on 6 Apr 2010 18:34 Thanks for responding, Dirk. You're right, I misspoke. The first time I "double-click" the field, the form to open will open to the record and then flash continuously. After that, I can't use the mouse. I get an hourglass until I break it with the CTRL+Alt+DEL. A single click doesn't cause the error to happen because the event is triggered on the double-click. "Dirk Goldgar" wrote: > "accesskastle" <accesskastle(a)discussions.microsoft.com> wrote in message > news:048D0057-F66B-44A8-85A5-8EAFD7E63CB4(a)microsoft.com... > > Hi- > > > > I have two forms. One is a datasheet view, the other a single form view, > > of > > pretty much the same data. When a user double-clicks a field in the > > datasheet view, the idea is that it will go to the single form with tabs, > > allowing the user to see all the data in a much more user friendly > > display. > > > > However, the first time I click on the field, > > Click, or double-click? > > > the form flashes continuously > > until I CTRL+ALT+DEL to start the Windows Task manager to break the > > process. > > Once I do this, everytime after, I don't experience the problem. > > > > I tried inserting Debug.Print statements to find out where it's going > > wrong, > > but it passes them all, with no error message: > > > > > > Private Sub Click_below_DblClick(Cancel As Integer) > > On Error GoTo Err_Click_below > > > > Debug.Print "Executing double-click..." > > RefreshAll > > Debug.Print "refreshed..." > > If Len(GISEventID) = 20 Then > > DoCmd.Echo False > > DoCmd.OpenForm "frmEventLogTab", acNormal, , "[EventID] = " & > > Forms!frmEventLog_tb!EventLogID > > Debug.Print "Opened tab form..." > > Forms!frmEventLog_tb.SetFocus > > Debug.Print "Setfocus..." > > DoCmd.Minimize > > DoCmd.Echo True > > 'Debug.Print "minimized...complete." > > Else > > MsgBox "Sorry! You must enter information before proceeding to tab > > view." > > Debug.Print "no info..." > > Cancel = True > > Debug.Print "cancel=true" > > End If > > > > Exit_Click_below: > > Exit Sub > > > > Err_Click_below: > > MsgBox Err.Number & " " & Err.Description > > End Sub > > Why are you setting Echo off? Is it just to avoid minimizing the wrong > form? I don't know, but I wonder if there's a problem involved in the > combination of SetFocus and Echo = False. What happens if you do this: > > '------ start of suggested code snippet ----- > If Len(GISEventID) = 20 Then > DoCmd.Minimize > DoEvents > DoCmd.OpenForm "frmEventLogTab", acNormal, , _ > "[EventID] = " & Forms!frmEventLog_tb!EventLogID > Debug.Print "Opened tab form..." > '------ end of suggested code snippet ----- > > Is there code in the Open, Load, or Current events of frmEventLogTab that > might be relevant? > > -- > Dirk Goldgar, MS Access MVP > Access tips: www.datagnostics.com/tips.html > > (please reply to the newsgroup) >
From: Dirk Goldgar on 6 Apr 2010 19:54 "accesskastle" <accesskastle(a)discussions.microsoft.com> wrote in message news:93E51AA1-C5A5-4BA4-915B-F4AA04B95B16(a)microsoft.com... > Thanks for responding, Dirk. You're right, I misspoke. The first time I > "double-click" the field, the form to open will open to the record and > then > flash continuously. After that, I can't use the mouse. I get an > hourglass > until I break it with the CTRL+Alt+DEL. A single click doesn't cause the > error to happen because the event is triggered on the double-click. Did you try the revised code I posted, to see if it makes a difference? -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup)
From: accesskastle on 7 Apr 2010 22:03 Thanks, but the problem still occurs with the code you supplied. The problem was occuring before I threw the echo statement in there. I was just trying to stop it from repainting before the process was complete. I commented everything out except for the DoCmd.Open statement, and it still happened. I wonder if it has to do with recordsets. My DB is split frontend backend, the backend on a local shared drive. The 2nd (tabbed) form has a table as its Recordsource. You think I should try set this runtime? I don't know what else it could be. The form to open has no open, close, load form level events, and only two control level events. "Dirk Goldgar" wrote: > "accesskastle" <accesskastle(a)discussions.microsoft.com> wrote in message > news:93E51AA1-C5A5-4BA4-915B-F4AA04B95B16(a)microsoft.com... > > Thanks for responding, Dirk. You're right, I misspoke. The first time I > > "double-click" the field, the form to open will open to the record and > > then > > flash continuously. After that, I can't use the mouse. I get an > > hourglass > > until I break it with the CTRL+Alt+DEL. A single click doesn't cause the > > error to happen because the event is triggered on the double-click. > > Did you try the revised code I posted, to see if it makes a difference? > > -- > Dirk Goldgar, MS Access MVP > Access tips: www.datagnostics.com/tips.html > > (please reply to the newsgroup) >
|
Next
|
Last
Pages: 1 2 Prev: syntax help requested Next: How to avoid duplicate entry in the subform |