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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing a subform that has no records

Status
Not open for further replies.

villan60

Technical User
Jul 5, 2001
23
ZA
When I go to a record on my main form that has no related records in the subform recordset, the form does not display. This obviously happens when I add a new record to my main form as well.

I need the subform to be displayed though, so that I can add a related record.

Any ideas?
Villan
 
As a side to my subform, I use an additional form that is called details. It carries the foreign key and enters it on an ADD new record. Works well.

rollie@bwsys.net
 
I don't quite follow what you are doing there. In the interim I have worked out that I can display the form by saying me.subform.form.allowadditions in the addnew button of the main form. There are some small issues I still have to work on but I am sure I will be able to sort them out.

Thanks for your help.

Villan
 
There is just a cmdButton on the form that calls a form with a queery tied to the entries in the subform.

R
 

One thing I have is a blank subform with a button to add a new record.

When clicked it:

sets subform allowadditions to true
adds a record
fills in default values (date, time, initials) - filled in by code rather than default value for more control.
sets allow additions to false
sets focus to the correct field in the subform.

and in the on-exit of the subform it:
re-orders the subform records
updates the field that counts the subform records and runs a check against the results

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top