Checking a subform for data

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

I have a form [Frm1] with a subform [sfrm1]
Parent-child linked by AppID
sfrm1 is datasheet view and used to select multple items-
ie. enter data that is stored in tblItems
AppID, ItemID, Description
When Frm1 closes, how can i check if any data has has been entered using the
subform.
Basically, i want to display a msgbox if Frm 1 closes and no data has been
entered in sfrm1.
Thanks
 
I would add a field to my main form and default the value to false.

I would add an event procedure to my subform in the "AfterInsert" event to
update the field on my main form with a value or true.

In the OnClose event of my main form, I'd ceck the value of that field.

I'm sure there are several other options available.

Rick
 
Note that the new field does not need to be visable.


Rick said:
I would add a field to my main form and default the value to false.

I would add an event procedure to my subform in the "AfterInsert" event to
update the field on my main form with a value or true.

In the OnClose event of my main form, I'd ceck the value of that field.

I'm sure there are several other options available.

Rick




Junior said:
I have a form [Frm1] with a subform [sfrm1]
Parent-child linked by AppID
sfrm1 is datasheet view and used to select multple items-
ie. enter data that is stored in tblItems
AppID, ItemID, Description
When Frm1 closes, how can i check if any data has has been entered using the
subform.
Basically, i want to display a msgbox if Frm 1 closes and no data has been
entered in sfrm1.
Thanks
 
Rick - i'll try your idea - thanks
Rick said:
I would add a field to my main form and default the value to false.

I would add an event procedure to my subform in the "AfterInsert" event to
update the field on my main form with a value or true.

In the OnClose event of my main form, I'd ceck the value of that field.

I'm sure there are several other options available.

Rick




Junior said:
I have a form [Frm1] with a subform [sfrm1]
Parent-child linked by AppID
sfrm1 is datasheet view and used to select multple items-
ie. enter data that is stored in tblItems
AppID, ItemID, Description
When Frm1 closes, how can i check if any data has has been entered using the
subform.
Basically, i want to display a msgbox if Frm 1 closes and no data has been
entered in sfrm1.
Thanks
 

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