subform problems - I need some opinions

T

trevi

hi,
I think I posted a question before about this, but I still can't fix my
problem. I have linked a form and subform. They work fine except when I first
bring the form up.
Instead of my form being blank, I get the last two records entered in the
subform. I have a combo box on the main form which is blank(that's what I
want ) when I first pull my form up. I tried these things to get rid of the
records appearing in the subform:
Load event of main: me.subform.setfocus
docmd.gotorecord,record:=acnewrec
I put the same code in the subform current ( not sure if this is really
correct).
I tried to set a recordset to the underlying recordsetclone of the subform ,
and tried
rs.addnew, but nothing works. How do I fix this? I welcome any suggestion!

thanks !!!!
 
M

Marshall Barton

trevi said:
I have linked a form and subform. They work fine except when I first
bring the form up.
Instead of my form being blank, I get the last two records entered in the
subform. I have a combo box on the main form which is blank(that's what I
want ) when I first pull my form up.
[]


Maybe the Link Master/Child properties are not set
appropriately??

How is the combo box involved in your arrangement?
 
G

Gerwin Berentschot

Never seen this behaviour before. I cannot say what causes it, because I have
to little information for that. A quick and dirty solution might be to put
the following line in the on current event of the form:

me.subfrm.requery
 
T

trevi

I checked the linked fields and they seem correct. When I click on a
selection from the combo box, I pull up the correct records in the subform.
It's just when I first open up the form, I get the last two records entered.
Very odd.

Marshall Barton said:
trevi said:
I have linked a form and subform. They work fine except when I first
bring the form up.
Instead of my form being blank, I get the last two records entered in the
subform. I have a combo box on the main form which is blank(that's what I
want ) when I first pull my form up.
[]


Maybe the Link Master/Child properties are not set
appropriately??

How is the combo box involved in your arrangement?
 
M

Marshall Barton

I have never seen a subform display records that are
unrelated to the LinkMaster/Child properties. Maybe there
is something about those child data fields that matches up
with the main form's initial link master controls/fields.

If the link master controls are unbound, check their values.
--
Marsh
MVP [MS Access]

I checked the linked fields and they seem correct. When I click on a
selection from the combo box, I pull up the correct records in the subform.
It's just when I first open up the form, I get the last two records entered.
Very odd.

Marshall Barton said:
trevi said:
I have linked a form and subform. They work fine except when I first
bring the form up.
Instead of my form being blank, I get the last two records entered in the
subform. I have a combo box on the main form which is blank(that's what I
want ) when I first pull my form up.
[]


Maybe the Link Master/Child properties are not set
appropriately??

How is the combo box involved in your arrangement?
 
Top