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

Disconnected Recordset Not Recognising new record added within form

Status
Not open for further replies.

LeanneGodney

Technical User
Mar 7, 2002
175
GB
Hi there,

I'm having quite a big issue with my ADP at the moment. I have a disconnected recordset that is created when the form opens. The form's recordset is set to the disconnected recordset.

The user starts adding a new record. For my date fields I don't allow manual entry because of different date formats, so the user has to double click the field to get a calendar control. They choose the date they're interested in.

When they click ok my code tries to write the new date to the disconnected recordset's current record. The fact that it's a date is irrelevant. Trouble is that the disconnected recordset has not recognised that a new record has been added yet! So I get a BOF/EOF error. Even though the form has a newly created unsaved record!

I have tried forcing the form to save when the user double clicks, but this saves the record in the form without it registering in the disconnected recordset!

I'm sure you can understand my frustration.

Why does an ADP disconnected recordset (ADODB) SOMETIMES recognise that a new record has been added, and sometimes not?

Does anyone know how to fix this? I've created a silly fix that clones the disconnected recordset, empties the disconnected recordset and then set it back to the clone. This works, but I don't like it.

Can anyone shed some light on the subject??

Thanks,
Leanne
 
instead of writing the date to the recordset, have you tried changing the value of the date text box on your form?

--------------------
Procrastinate Now!
 
Yes I have. Often get an error saying that the method failed writing to the textbox. I used to write to the forms control initially, but that started failing, so moved to the disconnected recordset.

i've actually sorted this problem out with a hacker fix... Instead of writing to the disconnected recordset I set a variable to the form's recordset, write to that, and then set the disconnected recordset = the forms recordset. Stupid work-a-round, but it works, and if someone else has the same problem they can at least get the thing working with this fix.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top