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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
The Right Event
I am looking for an event that fires when I change to a new record.
Here is what I am trying to accomplish: I have a subform that has a combo box in it that querys only classes that the teacher in the main form is able to teach. The form loads right. and selects the right classes. However when I move to the next teacher, the combo box still contains the last query. I've tried everything I know. I thought that the OnCurrent Event would work but it doesn't. Could anyone point me in the right direction for the right event that will run even when just viewing a new record? thanks so much in advance. |
#2
|
|||
|
|||
The Right Event
The OnCurrent event is exactly the right place to requery the combo box.
Maybe something wrong with your code? Can you post it? Another possibility is that you are using a split form in Access 2007. If you use the datasheet portion of a split form to change records, the OnCurrent event fires, but the field values available to your code are *for the record you just left*, not the one you are going to. There's no workaround for this that I can find. Can people *please* state what version they are using. With A2007 being so different, this is more important than ever. "Doctor" wrote in message ... I am looking for an event that fires when I change to a new record. Here is what I am trying to accomplish: I have a subform that has a combo box in it that querys only classes that the teacher in the main form is able to teach. The form loads right. and selects the right classes. However when I move to the next teacher, the combo box still contains the last query. I've tried everything I know. I thought that the OnCurrent Event would work but it doesn't. Could anyone point me in the right direction for the right event that will run even when just viewing a new record? thanks so much in advance. |
#3
|
|||
|
|||
The Right Event
The Current event is the correct event. It fires each time you change
records, regardless of whether the record is new or existing. How is the combo box in the subform filtered? It is a bound control? -- Dave Hargis, Microsoft Access MVP "Doctor" wrote: I am looking for an event that fires when I change to a new record. Here is what I am trying to accomplish: I have a subform that has a combo box in it that querys only classes that the teacher in the main form is able to teach. The form loads right. and selects the right classes. However when I move to the next teacher, the combo box still contains the last query. I've tried everything I know. I thought that the OnCurrent Event would work but it doesn't. Could anyone point me in the right direction for the right event that will run even when just viewing a new record? thanks so much in advance. |
#4
|
|||
|
|||
The Right Event
Ahh!! I feel kinda dumb. In my subform there were several combo boxes to
requery On Current. I thought the main combo box was in there, but it wasn't. Thanks guys! "bcap" wrote: The OnCurrent event is exactly the right place to requery the combo box. Maybe something wrong with your code? Can you post it? Another possibility is that you are using a split form in Access 2007. If you use the datasheet portion of a split form to change records, the OnCurrent event fires, but the field values available to your code are *for the record you just left*, not the one you are going to. There's no workaround for this that I can find. Can people *please* state what version they are using. With A2007 being so different, this is more important than ever. "Doctor" wrote in message ... I am looking for an event that fires when I change to a new record. Here is what I am trying to accomplish: I have a subform that has a combo box in it that querys only classes that the teacher in the main form is able to teach. The form loads right. and selects the right classes. However when I move to the next teacher, the combo box still contains the last query. I've tried everything I know. I thought that the OnCurrent Event would work but it doesn't. Could anyone point me in the right direction for the right event that will run even when just viewing a new record? thanks so much in advance. |
Thread Tools | |
Display Modes | |
|
|