Access Crash when Form size is to small with recordsource change

  • Thread starter Thread starter Andi Mayer
  • Start date Start date
A

Andi Mayer

Hi Friends

i have a funny problem.

Win XP, Access2002

I shring and stretch a continous Form to fit the recordcount.

in the case of Zero records, the Form shows only the Header and the
footer.

If I change now the Recordsource to show records, Access is crashing
with the usual " I don't know whats happen, but send a report to MS".

a simple :
if Me.recordsetClone.recordcount=0 then
me.insideheigth=2* Me.insideheight
endif

is helping

is this a "normal" beheviour from Access or is something wrong with
this Form?

If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
Andi, you can very easily crash Access if the new RecordSource statement is
missing one of the fields in the original RecordSource. When this happens,
you have a control bound to a field that just disappeared, and Access
doesn't cope.

It can also crash if a field changes data type. We are talking about a
calculated field here: obviously a field bound to a table field won't change
type. JET determines the type of a calculated field based on the first few
rows, so if those rows are Null (or if there are no records), then the type
changes. To avoid this, explicitly typecast the calculation. Details:
http://members.iinet.net.au/~allenbrowne/ser-45.html

If your form has a subform, there is another bug that causes A2002 and 2003
to crash (shut down by Windows), and the solution is to add a control for
the foreign key field. Post back if this could your issue.
 
Andi, you can very easily crash Access if the new RecordSource statement is
missing one of the fields in the original RecordSource. When this happens,
you have a control bound to a field that just disappeared, and Access
doesn't cope.

Hi Allen
it's the other way around:

SQL= SELECT * FROM tTab WHERE tField=0
the result is an empty recordsource (without Problem), therefore I set
the insideheight of the form to header.heigt+footerHeight.

if I leave the WHERE-clause out on the next run, Access is crashing on
the line: Me.Recordsource=SQL

It took me 4 hours to find that it's crashing on this line, because I
changed my Sizing-Software and I thought the error is in the
sizing-Class.
Actually it was the change, because with the new version I don't leave
any space for the Detail-section in the Form.

To go from 0 records to ++records, the Form-size has to be at least
that high, that one record can fit in the Detail-section.

Checked it now with section(acDetail).hight/2 and it's crashing again.
Played around and found: minimum is Detail-Heigth-30.

Any Idee?




If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
Back
Top