W
WCDoan
It seems that it's not the add button that's making the extra record in the
subform as I previously posted. It happens every time I enter a record in the
subform and then go to the next record so that the pencil mark appears to the
left of the record. If at this point, when nothing is entered into this
record with the pencil showing, I press the 'main menu' button, it adds a new
record. I don't understand why either. If I put a stop statement in the
unload event of the subform and check the value of the Me.SalesID, it's
whatever the record that I actually entered data into which is what I want.
However, when the subform is closed, there's an empty record added which is
one more than the record that actually has data in it. I put a stop in the
very first field of the subform record and checked the value of the
Me.SalesID and at this time with the pencil showing it says it's null, yet
when I check it at the unload event of the form, it's the value of the record
that had date entered. This really baffles me. I found a question in the
discussion group with an answer from Klatuu that I think would solve my
problem by using the Undo command at the Unload Event, but the Me.SalesID at
this point has the value of the record that I entered data into. And yet,
when I check this Me.SalesID value in the first field of the record where the
pencil shows, it's null. I'll try to show you:
1. Me.SalesID = Null - checked value before first field of record.
2. Me.SalesID = 29 - After entering data checked ID value and then tabbed
to next record.
3. Me.SalesID = Null - first field of next record, pencil showing
4. Me.SalesID = 29 - press 'main menu' button on main form, put check in
unload event of subform get this value
5. Me.SalesID = 30 - check table and there's extra record.
Do you understand what's happening because I sure don't? If Me.SalesID =
null which is what it is with the pencil showing and then I basically close
the form by pressing the 'main menu' button and Me.SalesID changes to 29 and
then adds another record at 30. I'm totally confused. Please enlighten me.
Thanks,
RandyM
subform as I previously posted. It happens every time I enter a record in the
subform and then go to the next record so that the pencil mark appears to the
left of the record. If at this point, when nothing is entered into this
record with the pencil showing, I press the 'main menu' button, it adds a new
record. I don't understand why either. If I put a stop statement in the
unload event of the subform and check the value of the Me.SalesID, it's
whatever the record that I actually entered data into which is what I want.
However, when the subform is closed, there's an empty record added which is
one more than the record that actually has data in it. I put a stop in the
very first field of the subform record and checked the value of the
Me.SalesID and at this time with the pencil showing it says it's null, yet
when I check it at the unload event of the form, it's the value of the record
that had date entered. This really baffles me. I found a question in the
discussion group with an answer from Klatuu that I think would solve my
problem by using the Undo command at the Unload Event, but the Me.SalesID at
this point has the value of the record that I entered data into. And yet,
when I check this Me.SalesID value in the first field of the record where the
pencil shows, it's null. I'll try to show you:
1. Me.SalesID = Null - checked value before first field of record.
2. Me.SalesID = 29 - After entering data checked ID value and then tabbed
to next record.
3. Me.SalesID = Null - first field of next record, pencil showing
4. Me.SalesID = 29 - press 'main menu' button on main form, put check in
unload event of subform get this value
5. Me.SalesID = 30 - check table and there's extra record.
Do you understand what's happening because I sure don't? If Me.SalesID =
null which is what it is with the pencil showing and then I basically close
the form by pressing the 'main menu' button and Me.SalesID changes to 29 and
then adds another record at 30. I'm totally confused. Please enlighten me.
Thanks,
RandyM