If SubForm HasNoData

B

Bonnie

Using A02. I have a contract status tab (qContractTbl)on
my fNewBus that has a subform showing me if a bill has
been sent and/or paid yet. The subform pulls from
qFeesTbl. I have a checkbox in my ContractTbl to be
checked if the bill has been sent and paid as part of the
process. I can put a text field on my contract status tab
with:

=IIf(isnull([NewBusSubInstallBill].[Form]![DatePd]),"",
[NewBusSubInstallBill].[Form]![DatePd])

Then, I can have my form's BeforeUpdate event checkmark
the paid box IF it has been paid. But, I'm getting #Error
when the subform has no data. I can handle NoData in
reports but can't find anything for forms. I'm okay if
there is data but messed up on no data.

Am I on the right track? Is there a better way for a non-
guru newbie programmer? Do I need the InstallBill subform
on my tab at all? Can I just reference the query results?

Thanks in advance for any help or advice. Love you guys!!!
 
M

Marshall Barton

Bonnie said:
Using A02. I have a contract status tab (qContractTbl)on
my fNewBus that has a subform showing me if a bill has
been sent and/or paid yet. The subform pulls from
qFeesTbl. I have a checkbox in my ContractTbl to be
checked if the bill has been sent and paid as part of the
process. I can put a text field on my contract status tab
with:

=IIf(isnull([NewBusSubInstallBill].[Form]![DatePd]),"",
[NewBusSubInstallBill].[Form]![DatePd])

Then, I can have my form's BeforeUpdate event checkmark
the paid box IF it has been paid. But, I'm getting #Error
when the subform has no data. I can handle NoData in
reports but can't find anything for forms. I'm okay if
there is data but messed up on no data.

You can check the subform's recordset clone's record count
to see if it has no records.

Not sure if this is exactly what you want, but it should get
you started:

=IIf(NewBusSubInstallBill.Form.RecordsetClone.RecordCount=0,
"", [NewBusSubInstallBill].[Form]![DatePd])
 
B

Bonnie

You are an angel! Thank you VERY much Marshall. It works
perfectly. You have helped me a number of times and always
by having a good sense of where I am in developing as a
programmer. You don't go over my head, too far. Ready to
help me stay above water but making me work, too.

Seriously, thank you for taking time to help others. I
truly appreciate it.
-----Original Message-----
Bonnie said:
Using A02. I have a contract status tab (qContractTbl)on
my fNewBus that has a subform showing me if a bill has
been sent and/or paid yet. The subform pulls from
qFeesTbl. I have a checkbox in my ContractTbl to be
checked if the bill has been sent and paid as part of the
process. I can put a text field on my contract status tab
with:

=IIf(isnull([NewBusSubInstallBill].[Form]![DatePd]),"",
[NewBusSubInstallBill].[Form]![DatePd])

Then, I can have my form's BeforeUpdate event checkmark
the paid box IF it has been paid. But, I'm getting #Error
when the subform has no data. I can handle NoData in
reports but can't find anything for forms. I'm okay if
there is data but messed up on no data.

You can check the subform's recordset clone's record count
to see if it has no records.

Not sure if this is exactly what you want, but it should get
you started:

=IIf (NewBusSubInstallBill.Form.RecordsetClone.RecordCount=0,
"", [NewBusSubInstallBill].[Form]![DatePd])
 
M

Marshall Barton

Bonnie said:
You are an angel! Thank you VERY much Marshall. It works
perfectly. You have helped me a number of times and always
by having a good sense of where I am in developing as a
programmer. You don't go over my head, too far. Ready to
help me stay above water but making me work, too.

Seriously, thank you for taking time to help others. I
truly appreciate it.


Thank you for these very kind words, it's so nice to be
appreciated. You just made my day!
 

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