Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update or refresh form control 1

Status
Not open for further replies.

hefly

Technical User
Feb 6, 2008
134
US
I have a form based upon a query. I would like to populate a control based on a field named Expires after I enter a record number in field Convno.

I have tried the following:


Code:
Private Sub Convno_LostFocus()
Me.OnLostFocus
Me.Refresh

End Sub

This returns an compile error "invalid use of property."

Is there a way to update the query when I loose focus on control "convno"

Thanks.

Hefly
 
Something like this ?
Code:
Private Sub Convno_LostFocus()
Me!Expires = [i]which value you want[/i]
End Sub

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV: I'm not sure... when I place a value, then I want the query to rerun and the form to load again with the values from the query.

E.g. convno is a number. I place the number 11 in the control and rerun the query to populate the other controls with other data associated with the record convno=11.

Does that help explain the problem?

Hefly

 
How the query is aware of the number placed in the control ?
Just a guess:
Code:
Private Sub Convno_LostFocus()
Me.RecordSource = Me.RecordSource 'safer way than Me.Requery
End Sub

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV

That is it! THANK YOU!!!

Hefly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top