lost subforms for new records

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

Guest

I'm back again! I'm sure I've seen this issue before too but couldn't find
it in a search. After much help from the group, I thought I had my subforms
and forms working. I can enter on the first record in my database just fine
but when I add a new record, none of my subforms appear. I was thinking that
maybe the problem is that I should requery the subforms (On Load? On Open?).
I have more than one subform; can I requery them all in the same code?
Would it be Me.Parent.Subfrm_Name.Requery

Thanks a lot!
 
carrietom said:
I'm back again! I'm sure I've seen this issue before too but couldn't find
it in a search. After much help from the group, I thought I had my subforms
and forms working. I can enter on the first record in my database just fine
but when I add a new record, none of my subforms appear. I was thinking that
maybe the problem is that I should requery the subforms (On Load? On Open?).
I have more than one subform; can I requery them all in the same code?
Would it be Me.Parent.Subfrm_Name.Requery


It's unlikely that you need to requery the subforms. More
likely, you have set their AllowAdditions property to No.

If the problem is not that simple, please provide more
details, especially their Link Maste/Child Fields
properties.
 
I'm back again! I'm sure I've seen this issue before too but couldn't find
it in a search. After much help from the group, I thought I had my subforms
and forms working. I can enter on the first record in my database just fine
but when I add a new record, none of my subforms appear. I was thinking that
maybe the problem is that I should requery the subforms (On Load? On Open?).
I have more than one subform; can I requery them all in the same code?
Would it be Me.Parent.Subfrm_Name.Requery

Thanks a lot!

Whoa. You don't need ANY code to link forms and subforms. The
Master/Child Link Field takes care of it automatically.

What are the Recordsources of your mainform and subform?
What are the Master and Child Link Fields?
What do you mean by "the first record in your database"? Databases per
se don't have records - tables within a database have records. How are
your Tables related?

John W. Vinson[MVP]
 
Hello, when I said the first record (i meant the first ID entered into the
table)

Further to Marshall's email I do have this code:

Private Sub Form_Current()
Me.AllowAdditions = Me.RecordsetClone.RecordCount = 0
End Sub

I am trying to ensure that each subform only allows one addition. This is a
very long story but I have some action and due dates that I need to be able
to report on (ie. most recent due date) so I have those in my detail table.

I then have a main form (main table) and a number of subforms (all based on
the detail table). The subforms are each for a different action (Date_Type)
and needed to be seperate due to where they needed to be on the forms. I
didn't set up several instances of the same subform because they all have
different calculation reminder dates (and some mre than one). (There is a
post from a couple of days ago about 7 subforms).

I have invisible text boxes on the form where the names are txtDateType1,
Control Source=1. The Child Link is PNG_ID; Date_Type and the Parent Link is
PNG_ID; txtDateType1.

Essentially what should happen is that the user will enter different actions
and due dates at different times as the project moves along and they will
have any combination of the 7 actions. I know this would work just fine if I
had one continuous subform but it doesn't really work for the user that way.
While the user will have any or all of the Date_Types for each project - they
will never have more than one of each. I would like them to enter their one
instance and then not be allowed to enter another one (which is why I put the
code in above). I guess if I take that code out - it sounds like it might
work but then I am still stuck with the user still being able to enter more
than one set of dates for the Date_Type.

I hope this is enough of an explanation - thanks a lot!
 
I am still stuck with the user still being able to enter more
than one set of dates for the Date_Type.

Sounds like you could put a joint two-field unique Index on the
Date_Type field and the date field.

John W. Vinson[MVP]
 
Back
Top