handling a No-Additions form that goes blank

  • Thread starter Thread starter Paul James
  • Start date Start date
P

Paul James

I have a form whose Allow Additions property is set to No. When the form
opens and there are no records in the form's Recordset, the entire form goes
blank. That is, not only do the bound controls disappear from the form, but
other objects such as labels and command buttons also disappear, so the user
can see nothing but a blank form.

I'm thinking that if I could put something in the form's Open Event that
could tell there are no records, then I could also have the Open Event close
the form and open another form that gave the user an explanation, or take
other suitable action. Would this be a good way to handle the situation?
If so, how can you test to see if there are no records in the form's
recordset in VBA?

Otherwise, is there a better way to do this?

Thanks in advance,

Paul
 
You could modify this...

If IsNull(DLookup("[PaymentID]", "[Payments]",
"[OrderID]="Forms![Pledges]![Pledges Subform].Form![OrderID])) Then
MsgBox "There is no data to view."
Else
DoCmd.OpenForm "Payments", , , "[Payments]![OrderID] =
Forms![Pledges]![Pledges Subform].Form![OrderID]"
End If

Max
 
Only the detail section goes blank. Put the form header into the
form header section, and put the command buttons into the form footer
section.

(david)
 
Another good suggestion.

Thanks, David.

Is it my imagination, or do we have a disproportionate number of Access
experts in Australia?

(Disproportionate to the population, that is).
 
I am sure there are many good German/Italian/Spanish speaking Access
experts that we never hear from here. But I wonder about the UK.
Do they have relatively high Internet costs? In Aus, the UK has the
reputation of having very poor programming skills. I wonder if that
is true? Or is it only a very offensive racist/chauvinist myth?

Any Home County/London Access programmers welcome to respond!

(david)
 
Back
Top