Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank Sub-Form

Status
Not open for further replies.

BillEchert

Programmer
Jun 25, 2003
5
0
0
US
Hi, I am having a problem with displaying a blank sub-form.

I have a form that displays patient information and a sub-form that displays the corresponding claim information. New patient and claim information is also entered on this form/sub-form.

The sub-form has navigation buttons to moved between the claims (previous, next, new).

The problem occurs after the next button, which uses GoToRecord,,acNext, receives a 2105 error message (no more records). After the message box is cleared and the New Patient button on the main form is clicked (GoToRecord,,acNewRec), the patient form presents properly with all fields blank. However, the sub-form is literally blank - no fields.

Any help you can provide would be greatly appreciated.

Thanks,
Bill

 
Hi,

I believe that is the intended behavior in access for subforms. I have the same scenario (though I do not see it as a problem :p) in which I have a form and subform. When the subform has no records to display, the fields in the 'detail' section of the form do not appear. You would notice, that if you ever were to open your main form, but had no records to display, that it too would appear blank ... no fields. That's just what access does when there are no records to display. If you have 'AllowAdditions' set to false, that is, otherwise, your new record will show when there are no records to display

As for your problem when you recieve you 'no more records' error ... in the procedure that calls 'GoToRecord,,acNext', simply place a 'On Error Resum Next' statement at the top of your procedure (before any declarations and code, but after the actual name (signature) of the procedure.

Hope this helps a bit (^_^)

-Jedi420

A man who has risked his life knows that careers are worthless, and a man who will not risk his career has a worthless life.
 
It was the AllowAdditions that was causing the problem.

Thanks,
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top