Refreshing with DLookUp

D

dar

I appologize if I asked before, but need to clarify.

I have a form with subform. The main form has text box with DLookup as
control source. It looks up the therapist assigned to a specific floor.

The subform is linked to main form via Med Record Number. The subform may
have several records. The floor unit on sub form may change (if patient is
moved) thereby changing the therapist. At one time I thought it was working
when I refreshed the subform with Me.Refresh on the AfterUpdate event of Unit.

However, the records keep jumping back to the first record for that patient
and does not update the change in floor.

As long as I don't change the units I get correct information.

Help would be appreciated again, and again, and again.
 
B

bhopper

If I understand what you are saying, you are trying to refresh your subform?

Me.Refresh does not work on subforms. You have to deal with them directly.
What has worked for me is the following:

Forms!<main form name>!<subform name>.Requery

This tells the database to go directly to the subform and update any changes.
 
D

dar

The txt box is on the main form with DLookup for value. The subform has the
Unit text box which affects the DLookUp value. When I change the Unit value,
I need to have the mainform refresh based on that info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top