Weird form problem

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Access 97: I have a form which works fine. I added the following code to the
On-Current event of the form;

If Forms![MyForm].MyBoundField Then
Forms![MyForm].MyRectangle.BorderColor = 255
Else
Forms![MyForm].MyRectangle.BorderColor = 12632256
End If

The problem is that if I run the app, go to this form and without doing
anything else, simply try to close access using X at the top right, the db
app closes by the access is merely minimised. From this point access will
not close, (it will minimise, maximise etc. though). I have to then kill it
using task manager and end task. I have done compact & repair and also
decompiled a few times and also imported into a new db a few times. Nothing
helps. Of course if I comment out the above code then everything works fine.

What is the problem? Why is the above code causing this problem?

Thanks

Regards
 
Does it work without the code. Try yo open just the database and try to
close out of it.

Rick
 
John

What kind of field is [MyBoundField]?

What happens if you explicitly test:

If [...]![MyBoundField] = True Then

Good luck

Jeff Boyce
<Access MVP>
 
It works! Hmmm....

Jeff Boyce said:
John

What kind of field is [MyBoundField]?

What happens if you explicitly test:

If [...]![MyBoundField] = True Then

Good luck

Jeff Boyce
<Access MVP>

John said:
Hi

Access 97: I have a form which works fine. I added the following code to the
On-Current event of the form;

If Forms![MyForm].MyBoundField Then
Forms![MyForm].MyRectangle.BorderColor = 255
Else
Forms![MyForm].MyRectangle.BorderColor = 12632256
End If

The problem is that if I run the app, go to this form and without doing
anything else, simply try to close access using X at the top right, the
db
app closes by the access is merely minimised. From this point access will
not close, (it will minimise, maximise etc. though). I have to then kill it
using task manager and end task. I have done compact & repair and also
decompiled a few times and also imported into a new db a few times. Nothing
helps. Of course if I comment out the above code then everything works fine.

What is the problem? Why is the above code causing this problem?

Thanks

Regards
 
John said:
It works! Hmmm....

Jeff Boyce said:
John

What kind of field is [MyBoundField]?

What happens if you explicitly test:

If [...]![MyBoundField] = True Then


John said:
Hi

Access 97: I have a form which works fine. I added the following
code to the On-Current event of the form;

If Forms![MyForm].MyBoundField Then
Forms![MyForm].MyRectangle.BorderColor = 255
Else
Forms![MyForm].MyRectangle.BorderColor = 12632256
End If

The problem is that if I run the app, go to this form and without
doing anything else, simply try to close access using X at the top
right, the db
app closes by the access is merely minimised.

This is a known bug in Access 97, caused by that specific form of
reference to a check-box:

If [checkbox control] Then

Any of these forms of reference get around it:

If [checkbox control] = True Then

If [checkbox control].Value Then

If ([checkbox control]) Then
 

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

Back
Top