Code works with loaded table but not with empty table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some VB code that works fine when my table has records but gives an
error when my table is empty.
The form has a tabbed control which has some subforms.
When I hit the 'create new record' button', the code sets the subform
AllowEdits property to True. When there are no records, the code fails with
"You entered an expression with an invalid reference to the property
Form/Report".
How do I get around this?
 
mscertified said:
I have some VB code that works fine when my table has records but gives an
error when my table is empty.
The form has a tabbed control which has some subforms.
When I hit the 'create new record' button', the code sets the subform
AllowEdits property to True. When there are no records, the code fails with
"You entered an expression with an invalid reference to the property
Form/Report".


Not clear what the issue is, but I think you need to set
AllowAdditions to True.

I'm not sure you need it, but you can check for the no
records situation by checking if
Me.subform.Form.RecordsetClone.RecordCount = 0
and possible taking some kind of corrective action??
 

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