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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to refresh a subform

Status
Not open for further replies.

lsantos

Programmer
Jun 9, 2003
24
AU
Hi,

I am created a 'Personal Details' form and a 'Survey Answers' subform to capture survey information.

On my subform I will capture a Yes or No answer to 16 questions to be stored in 'Survey Answers' file.

While on the 'Personal Details' form, on 'ContactID_Exit' (the 'Personal Details' key) I create 16 answers (via SQL stetement) in 'Survey Answers'. This way I hope that user only needs to go down the list and tick the appropriate yes/no boxes.

My problem is that the sub-form won't refresh until I move to the next 'Personal Details' record and get back into the previous record.

I tried on 'Personal Details' form:

Private Sub ContactID_Exit(Cancel As Integer)

Forms![Personal Details]![Survey Answers]!Form.Refresh
Forms![Personal Details]![Survey Answers]!Form.Repaint

End Sub

... here I get errors stating that can't find field 'Survey Answers'

... and on the 'Survey Answers' subForm:

Private Sub Form_Activate()

Me.Refresh
Me.Repaint

End Sub

... here nothing happens

What is the correct way of doing it?

Would there be a way to refresh the 'Survey Answers' subform on the fly?

Any suggestions will be very much appreciated.

Thank you
 
try
Forms![Personal Details]![Survey Answers]!Form.Requery

instead of
Forms![Personal Details]![Survey Answers]!Form.Refresh

Alec Doughty
Doughty Consulting P/L

"Life's a competition. Play hard, but play fair"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top