A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

What would cause this behavior?



 
 
Thread Tools Display Modes
  #1  
Old January 26th, 2007, 04:18 PM posted to microsoft.public.access.forms
Slez via AccessMonster.com
external usenet poster
 
Posts: 176
Default What would cause this behavior?

I have a form called frmMainScreen with a subform called frmProjectSubformTab,
which contains a subform called frmBid.

frmBid displays record in single form view. On each of those records is a
command button that opens another form called frmBidItems. When opened, that
form references the "ProjectID" that it was selected from in frmBid. It has
2 nested subforms: First is frmQryBidLineItems. frmBidLineItemsSubform is a
subform of that.

Now for the strange behavior. When I enter new records into
frmQryBidLineItems and then close frmBidItems, the record in frmBid is right
where I left it. (I.E. If I was in BidNumber "3", when I close the form,
frmBid is still on BidNumber "3".) But if I add new records in
frmBidLineItemsSubform, when I close frmBidItems, the record in frmBid
reverts back to BidNumber "1" (the first record).

I know that frmBid changes focus to the first record as soon as a new record
is added to frmBidLineItemsSubform. What might cause this behavior? It
didn't do this a few days ago. I may have changes another event or property
that affects this without realizing it. How can I identify what causes this?

Any input is appreciated!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200701/1

  #2  
Old January 26th, 2007, 04:39 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default What would cause this behavior?

I would look to see if there is a Requery method used in the code. It will
cause this to happen.
--
Dave Hargis, Microsoft Access MVP


"Slez via AccessMonster.com" wrote:

I have a form called frmMainScreen with a subform called frmProjectSubformTab,
which contains a subform called frmBid.

frmBid displays record in single form view. On each of those records is a
command button that opens another form called frmBidItems. When opened, that
form references the "ProjectID" that it was selected from in frmBid. It has
2 nested subforms: First is frmQryBidLineItems. frmBidLineItemsSubform is a
subform of that.

Now for the strange behavior. When I enter new records into
frmQryBidLineItems and then close frmBidItems, the record in frmBid is right
where I left it. (I.E. If I was in BidNumber "3", when I close the form,
frmBid is still on BidNumber "3".) But if I add new records in
frmBidLineItemsSubform, when I close frmBidItems, the record in frmBid
reverts back to BidNumber "1" (the first record).

I know that frmBid changes focus to the first record as soon as a new record
is added to frmBidLineItemsSubform. What might cause this behavior? It
didn't do this a few days ago. I may have changes another event or property
that affects this without realizing it. How can I identify what causes this?

Any input is appreciated!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200701/1


  #3  
Old January 29th, 2007, 03:02 PM posted to microsoft.public.access.forms
Slez via AccessMonster.com
external usenet poster
 
Posts: 176
Default What would cause this behavior?

I did have "Me.Parent.Recalc" in the After Update event. I tried it in the
On Close event and got the same result. The reason I had that was due to
some calculated controls in frmBid. I eliminated that code and it works as
intended. Thanks for the clue in!

I now need to refresh that form, which isn't a big deal, but do you know of
any way to recalc and still maintain focus on whatever record was/is
displayed?
Thanks!

Klatuu wrote:
I would look to see if there is a Requery method used in the code. It will
cause this to happen.
I have a form called frmMainScreen with a subform called frmProjectSubformTab,
which contains a subform called frmBid.

[quoted text clipped - 18 lines]

Any input is appreciated!


--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.