Form --> Subform Problem

  • Thread starter Thread starter frankos
  • Start date Start date
F

frankos

Guest
Hi guys, I have the following problem:

I have a form which contains within it a subform, the subform being a continuous one.

The form and subform are linked by a reference number. However the reference numbers are stored in a funny format, so they cannot be linked via wisards, but raher through the use of SQL.

I have developed an SQL statement that works and put it in the FORM_LOAD() property of the subform. This means that when the main form loads and displays the first record, the subform displays the correct subrecords as defined by my SQL statement.

So far so good, but here is where my problem lies:

When I navigate to the second record in the main form, the subform is NOT updated, but rather shows the results of the first record still. I assume I have to place the SQL statement (with some code) in a subform event, but I don't know which one.

Basically what I want to know is how can I get the subform to update when the main form is navigated?

Any help is much appreciated.
 
Move your code to the "On Current" section on your main form.

This will "fire" when the first record receives focus, and when subsequent records receive focus.

It will also fire when the form is refreshed or requeried.


Brad.
 
I works! I actually tried that before (having read it somewhere) but put it in the CURRENT of the sub-form rather than the main.

Mate, I could kiss you (especially since you look like a beer.)

Cheers!
 

Users who are viewing this thread

Back
Top Bottom