Can anyone see what I'm doing wrong?

Kraj

Registered User.
Local time
Today, 10:37
Joined
Aug 20, 2001
Messages
1,470
I have a main form (frmRadio) with a subform (subfrmRadioFrequencies). On the subform is a combo box that opens a third form (frmFrequencyEdit) on the OnNotInList event. I am trying to requery the subform after entereing a new record in frmFrequencyEdit but it keeps bombing out. I added this code to the OnClose event of frmFrequencyEdit:

Forms!frmRadio.Form!subfrmRadioFrequencies.Form.Requery

but Access keeps trying to find the field subfrmRadioFrequencies no matter if or where I have Form! or Form. etc. I've quadruple-checked the spellings and I've used the exact same syntax in a different database and it works. Am I just going nuts or have I missed something here?

Edit: It seems like any combination I can come up with of .'s and !'s and 'Form's either produces a user-defined error or refers to the subform as a field instead of a form. This is really ticking me off...
 
Last edited:
OK, well I got that straightened out but now it is telling me I have to save the current field before running the requery action. I tried adding a save prior to the reuqery and going to a new record on the current form with no change, so I can only assume the problem is on the subform. But what good does it do me if I have to save the record before I can requery the field?...the whole reason for the code is to display the new data when OnNotInList occurs. *sigh*
 
in the Unload Event of your form
Screen.PreviousControl.Requery
 
Well there's no error using that, but it has no effect on the combo box. It's the same as if there's no code at all. Why is it so hard to get a combo box to accept an update?
 
Kraj said:
Edit: It seems like any combination I can come up with of .'s and !'s and 'Form's either produces a user-defined error or refers to the subform as a field instead of a form. This is really ticking me off...
A subform is a control not a form. It is easy to think of it as a form but in reality it is a control on the parent form. You will find it in the controls group not the forms group.
 

Users who are viewing this thread

Back
Top Bottom