• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

ADO Recordset and SSTab problem

Here is my problem:
When i have bound text boxes on a form (They are bound to an ADO recordset) and if i edit them the ADOrs.Editmode is set to 1 like it should be. This happens when ever i leave the text box to click on a button or similar control. The problem is when i edit a record(bound text box) then directly [click] on one of the tabs in the SSTab control the ADOrs.Editmode never equals 1. It stays at 0 even if the record has been edited. Even I trap the tab click event and do an ADOrs.Update it does not reconize the data i placed in one of the bound text box controls. It seems to be a bug. Does anyone have a workaround except updtating the recordset on every textbox validate event? I would like to beable to do it when the user clicks another tab on the SSTab control. Any help is appreciated (sorry for the low points, thats all i currently have)
1 Solution
Put an update button. Use a flag which is set as soon as the bound text box is edited. Reset the flag on the Update button click only. Check the flag in Tab click.
Make the text boxes unbound. Populate them from your recordset. Have a flag for dirty form. Issue an update only when you are done, if the flag is set.

Cheers, John
I have experienced the same thing.  The above comments do not quite address your situation.

I tried for days to solve the problem.  In the end, I had to force the values in (which is what you are trying to avoid).

Microsoft support has acknowledged the problem and cannot suggest any other work-around.

Private Sub txtAmount_LostFocus
   With datADO.Recordset
      .Fields(txtAmount.DataField) = txtAmount
      .Move 0
   End With
End Sub

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

JaysorAuthor Commented:
northeyk- you are right the above comments do not address my problem. Because by the time the Tab.click event has occured the update buffer is cleared for some reason. If i use the "Tab Control" instead of the SStab do you know if that will solve my problem? Im reluctant to use that control because it does not act as a container object and i have to use frames that hide/un-hide witht he tab clicks. (One other question: is it possible to hide a control in the Design Environment?)

Also do you have the MSDN KB article that describes my orginal problem?
You can't hide a control in the design environment.  However, you can select it and choose "Order", then "Send to Back" from the "Format" menu to put it behind other controls.

If you decide to go with the Tab Control (which WILL solve your problem), here's how I use them.  I create a control array of frames and put them on top of eachother.  Then in the Tab Control's click event:

   For j = 1 To nNumberOfFrames
      frameT2S27(j).Visible = (j = tabT2S27.SelectedItem.Index)
   Next j

Note:  The first button is 1, not 0.

As for the MSDN KB Article number - I don't know it.  If I come across it, I'll send it your way.

JaysorAuthor Commented:
thanks for all your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now