By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

Form & SubForm Event problem

P: 48
Hi

I have a Form with a SubForm

The Form is bound to a Query, and is used for navigation.

In the event Form_Current there is :
wrkField = Me!TableField
SubForm.requery

The SubForm is UnBound

In the event SubForm_Current there is :
Me.SubFormField = wrkField
Msgbox Me.SubFormField

I don't understand why
- when navigating through the Query, for every occurence MsgBox is displayed twice (so SubForm_Current done twice)
- when Form is started, MsgBox is displayed twice (without any value) and two times (with the value of the first occurence)

Related to this, if it is possible to bind the (yet unbound controls of SubForm) to the wrkFields ? How ?

Thanks
Jan 10 '08 #1
Share this Question
Share on Google+
3 Replies


Dököll
Expert 100+
P: 2,364
Hi

I have a Form with a SubForm

The Form is bound to a Query, and is used for navigation.

In the event Form_Current there is :
wrkField = Me!TableField
SubForm.requery

The SubForm is UnBound

In the event SubForm_Current there is :
Me.SubFormField = wrkField
Msgbox Me.SubFormField

I don't understand why
- when navigating through the Query, for every occurence MsgBox is displayed twice (so SubForm_Current done twice)
- when Form is started, MsgBox is displayed twice (without any value) and two times (with the value of the first occurence)

Related to this, if it is possible to bind the (yet unbound controls of SubForm) to the wrkFields ? How ?

Thanks
Please forgive me, I did not quite understand what you are referring to, and I am sure you are saying what you need. Can you go into it more, precisely what you hope to achieve? Perhaps there's an idea we can refer you to.

In a bit!
Jan 11 '08 #2

P: 48
Please forgive me, I did not quite understand what you are referring to, and I am sure you are saying what you need. Can you go into it more, precisely what you hope to achieve? Perhaps there's an idea we can refer you to.

In a bit!
Don' know what I could tell more.

The Form is used to allow the user to navigate through the occurences presented to him by the Query

The SubForm (shows one occurence) is there to allow the user to do changes to the data, without immedeate commit to the table. The changes are only committed to the table after confirmation.

Of course, the MsgBox is just there for testing-purposes, it shows that SubForm_Current get's done twice for every occurence displayed
Jan 11 '08 #3

Minion
Expert 100+
P: 108
I'm stumped at this point why the events would be launching twice, but I have an idea it has something to do with their relationship to one another. One of the first things I might try is putting a break in the main form and they using F8 to step through the program to see if anything jumps out to you. Sometimes it's a recursive value that calls upon itself.

I'll keep thinking on this and post anything I can find.

Hope this helps.

- Minion -
Jan 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.