Error handling for empty subform

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

Guest

Hi

I have a command button on a main form that users can click to requery a
subform and get specific data. I want have a pop up message warning the user
if the subform is empty. I sort of know how to programme a message box in
VBA, but I'm not sure of the syntax to check for the empty subform.

I'm using Access 2002 and not too advanced with VBA.

Thanks in anticipation.
 
Thanks for your reply Arvin. However, please excuse my ignorance, can you
please expand on the RecordSetClone and RecordCount? Do I need to put values
in here?

Thanks
Winsa

Arvin Meyer said:
From the main form, the syntax would be:

=[Forms]![FormName]![SubFormName].[Form].[RecordsetClone].[RecordCount]

From inside the subform, the syntax would be:

=[Form].[RecordsetClone].[RecordCount]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

winsa said:
Hi

I have a command button on a main form that users can click to requery a
subform and get specific data. I want have a pop up message warning the user
if the subform is empty. I sort of know how to programme a message box in
VBA, but I'm not sure of the syntax to check for the empty subform.

I'm using Access 2002 and not too advanced with VBA.

Thanks in anticipation.
 
RecordSetClone is a form property and RecordCount is a property of a
recordset. Your only substitutions need to be FormName and SubFormName.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

winsa said:
Thanks for your reply Arvin. However, please excuse my ignorance, can you
please expand on the RecordSetClone and RecordCount? Do I need to put values
in here?

Thanks
Winsa

Arvin Meyer said:
From the main form, the syntax would be:

=[Forms]![FormName]![SubFormName].[Form].[RecordsetClone].[RecordCount]

From inside the subform, the syntax would be:

=[Form].[RecordsetClone].[RecordCount]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

winsa said:
Hi

I have a command button on a main form that users can click to requery a
subform and get specific data. I want have a pop up message warning
the
user
if the subform is empty. I sort of know how to programme a message box in
VBA, but I'm not sure of the syntax to check for the empty subform.

I'm using Access 2002 and not too advanced with VBA.

Thanks in anticipation.
 
Back
Top