Form Swapping Malfunction.....HELP?

J

Jay

I am working on the application which has a number of sub-form being swapped
out during data entry. The object control name is: "fra_Embed_fsub_Dataforms"
and here is a sample of the code behind the toggle buttons doing the swapping:

Select Case Me![fraSwapForms]
Case 1
Me![fra_Embed_fsub_Dataforms].SourceObject =
"frm_Product_BeerBtlsInfoData_Collection"
Case 2
Me![fra_Embed_fsub_Dataforms].SourceObject =
"frm_Product_BourbonInfoData_Collection"
Case 3
Me![fra_Embed_fsub_Dataforms].SourceObject =
"frm_Product_BrandyInfoData_Collection"
Case Else
MsgBox "This Selection Does Not Exist"
End Select

In the "AfterUpdate" section of the parent form. Now, this thing is not
working as it used to, I keep an error pointing the
"fra_Embed_fsub_Dataforms" control name. ALL the other sub-forms have their
own control frames and names. Is there a way to apply the same frame control
name to ALL sub-forms?

HELP??? Any assistance will be welcome.

Thanks,
 
V

Van T. Dinh

I normally use the OptionGroup_AfterUpdate Event, not the Form_AfterUpdate
Event.

The Form_AfterUpdate Event only fires when the data is being updated into
the Table.
 
J

Jay

Thanks Mr. Dinh:

I'm sorry, that is where I have the have it ( in OptionGroup_AfterUpdate
Event) too. However, I forgot to mention that I'm using Access 97. I don't
know if it's an issue with Access 97 or not?

I may be missing some SP's for Access 97 which could cause this behavior,
any ideas? I know, I know, I should move up to the latest versions of Access,
and I do have them up to the 2003 version, but, Access 97 has proven to be
the most stable version out there to date. I attempted using Access 2003 for
this project and kept getting some strange: "Access cannot communicate with
the OLE or ActiveX server" error messages. Then, I could not get any thing to
work correctly, at all! So I reverted back to Access 97!

I am open to any viable solutions yourself or any other guru out there may
have.

Thanks, for chiming in on this matter, I look forward to hearing from you
too, again.



Van T. Dinh said:
I normally use the OptionGroup_AfterUpdate Event, not the Form_AfterUpdate
Event.

The Form_AfterUpdate Event only fires when the data is being updated into
the Table.

--
HTH
Van T. Dinh
MVP (Access)




Jay said:
I am working on the application which has a number of sub-form being
swapped
out during data entry. The object control name is:
"fra_Embed_fsub_Dataforms"
and here is a sample of the code behind the toggle buttons doing the
swapping:

Select Case Me![fraSwapForms]
Case 1
Me![fra_Embed_fsub_Dataforms].SourceObject =
"frm_Product_BeerBtlsInfoData_Collection"
Case 2
Me![fra_Embed_fsub_Dataforms].SourceObject =
"frm_Product_BourbonInfoData_Collection"
Case 3
Me![fra_Embed_fsub_Dataforms].SourceObject =
"frm_Product_BrandyInfoData_Collection"
Case Else
MsgBox "This Selection Does Not Exist"
End Select

In the "AfterUpdate" section of the parent form. Now, this thing is not
working as it used to, I keep an error pointing the
"fra_Embed_fsub_Dataforms" control name. ALL the other sub-forms have
their
own control frames and names. Is there a way to apply the same frame
control
name to ALL sub-forms?

HELP??? Any assistance will be welcome.

Thanks,
 
V

Van T. Dinh

I never had this problem with Access97. However, I don't follow your
description just like the object you apply your code to. You wrote in the
original post:

"In the "AfterUpdate" section of the parent form."

and that's why I thought you had the code in the Form_AfterUpdate, not in
the OptionGroup_AfterUpdate Event.

Have you checked and make sure you have the correct name for the
SubformCONTROL (it is not a "Frame") as well as the names of the Forms being
used as SourceObjects?
 
J

Jay

Mr. Dinh:

Yes, I have checked to source object and the frame names. They are the same
when you drop the sub-forms unto the parent (calling) form. Then, I change
the frame name to one that is more in line with the name convention beginning
with "fra_" and shorten the name of the frame for each to i.e: "fra_Apple" or
"fra_Plum" etc, etc. However, the first sub-form frame gets the name used in
the "AfterUpdate" event of the "Option Group" code behind the buttons.

I am at a loss currently as to why it's not working properly any more!
 
V

Van T. Dinh

The standard naming convention uses the prefix "sfr" for the SubformControl
and "fsf" for the Forms being used as SourceObjects of SubformControls.

Sorry, don't know what's wrong with your se-up if all SubformControl name /
SourceObject names are correct. Did you get any error number / error
message?
 
J

Jay

Mr. Dinh:

I'm truly sorry for taking your time on this matter. After your second reply
I decided to take the whole thing apart and re-trace every step. I figurd
that instead of attempting to fix it, just re-do it. So, in re-building that
particular portion of the application I found that I had not been sending the
newer embedded sub-forms place unto the control to the back and leaving the
first in the front which was indexed as 0. Once I began to send the newer
sub-forms to the back,...the thing started working like a charm. It's been
around three years since I last used this function, so, I'd forgotten to send
the other sub-forms to the back. I assume that the application did not know
what to do when the buttons were clicked, thus it (the last to be placed
sub-form) just sat there looking back at me.

Again, thank you very much for pushing me to the edge and make me re-think
and undo and re-do the thing, which helped!

Appreciate to help.....
 
V

Van T. Dinh

Glad you worked it out ...

If I read you post correctly, I think you said that there is another
SubformControl with higher Z-order (the "layers" on the screen) which covers
the SubformControl with the changing SourceObject
([fra_Embed_fsub_Dataforms]?) and therefore you didn't see the changes ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top