Update subform query

P

PD

On my form I have "Model" linked to "Model" on my subform. My subform data
source is a select query. It works well, but the subform will not update
until you step off the record. I am trying to update my subform when I
change the Model selection.

Thanks,
 
J

Jeanette Cunningham

Are you trying to choose a model on the main form and then show the details
for that model on the subform?

You can do this if you have an unbound combo on the main form where users
can select a model.

On the after update event for the model combo put
Me.Requery

Jeanette Cunningham
 
P

PD

Thanks Jeanette,

After I added the "Me.Requery" to the after update the form acted as follows;

I select new record (all fields blank), I select a model from the drop down
and the form reverts to record number 1 and the subform displays the
information contained in record 1 even though the model is different.
Perhaps this is because the Model combo is bound?
 
P

PD

Jeanette,

I was able to use "Refresh" in the Model Combo after update event. It seems
to work well. Another question...how can I double-click the text in a field
and have it copied to another field on the same form?

Thanks again!
 
J

Jeanette Cunningham

PD,

Code the double click event
Select the control txtOriginal
property dialog | events tab | click the button with ellipsis ( ...)
opposite On Dbl Click
choose code builder | OK
type the following line in the code windw that opens

Me.txtCopy = Me.txtOriginal

It should look like this:

Private Sub txtOriginal_DblClick(Cancel As Integer)
Me.txtCopy = Me.txtOriginal
End Sub


replace txtOriginal and txtCopy with the names of your controls

Jeanette Cunningham
 

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

Top