Form flashing

A

accesskastle

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?
 
D

Dirk Goldgar

accesskastle said:
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?
 
A

accesskastle

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 said:
accesskastle said:
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)
 
D

Dirk Goldgar

accesskastle said:
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?
 
A

accesskastle

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.
 
D

Dirk Goldgar

accesskastle said:
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.


I'm puzzled. *Something* odd is going on. If you'd like to send me a
cut-down copy of your database, containing only the elements necessary to
demonstrate the problem, compacted and then zipped to less than 1MB in size
(preferably much smaller) -- I'll have a look at it, time permitting. I'll
need a copy of both the front-end and the back-end, but I don't want all the
data in the back-end, just enough to demo.

You can send it to the address derived by removing NO SPAM and ".invalid"
from the reply address of this message. If that address isn't visible to
you, you can get my address from my web site, which is listed in my sig. Do
*not* post my real address in the newsgroup -- I don't want to be buried in
spam and viruses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top