Connecting Tech Pros Worldwide Forums | Help | Site Map

Updaing list of names on the subform

Newbie
 
Join Date: Jul 2009
Posts: 13
#1: Jul 6 '09
I have a form called NewPatient for new patients entry. What i want is that, i need to update or completely refresh the MainForm and it will automatically display in subform1 for the list of patients currently admitted.

I try the requery and refresh upon MainForm_Active() but nothing happen. all i will do is that to press the F5 in order to refresh it completely.


-Thanks for helping-

Max D's Avatar
Newbie
 
Join Date: Jul 2009
Posts: 7
#2: Jul 6 '09

re: Updaing list of names on the subform


Simple Form.Requery does the thing - at least in Access 2007.

Remark: You don't need to substitute something instead of "Form", write it as is.
Newbie
 
Join Date: Jul 2009
Posts: 13
#3: Jul 6 '09

re: Updaing list of names on the subform


yea i did that but nothing happened. im using ms 2007 too.
Max D's Avatar
Newbie
 
Join Date: Jul 2009
Posts: 7
#4: Jul 6 '09

re: Updaing list of names on the subform


There can be the problem because of entering new record, which can be not inserted to database in fact.

Try testing it on some existing record, not on creating a new one.
Newbie
 
Join Date: Jul 2009
Posts: 13
#5: Jul 6 '09

re: Updaing list of names on the subform


Its not working still i dont know why.
Max D's Avatar
Newbie
 
Join Date: Jul 2009
Posts: 7
#6: Jul 6 '09

re: Updaing list of names on the subform


Can you share and MDB to take a look?
mshmyob's Avatar
Expert
 
Join Date: Jan 2008
Location: witness protection
Posts: 618
#7: Jul 6 '09

re: Updaing list of names on the subform


I don't have enough info but I do not think that putting it in the Activate event will do what you want. You will need to put it somewhere else.

cheers,
Newbie
 
Join Date: Jul 2009
Posts: 13
#8: Jul 6 '09

re: Updaing list of names on the subform


Quote:

Originally Posted by mshmyob View Post

I don't have enough info but I do not think that putting it in the Activate event will do what you want. You will need to put it somewhere else.

cheers,

But how would i do it?
mshmyob's Avatar
Expert
 
Join Date: Jan 2008
Location: witness protection
Posts: 618
#9: Jul 7 '09

re: Updaing list of names on the subform


Again without more details from you, most often this type of thing would be done in the AfterUpdate event of the form or a control or in the AfterInsert event.

cheers,

Quote:

Originally Posted by mjworks2009 View Post

But how would i do it?

Newbie
 
Join Date: Jul 2009
Posts: 13
#10: Jul 7 '09

re: Updaing list of names on the subform


I figure it out how to. i used the timer event

Private Sub Form_Timer()
If Me.Timer = 0 Then
Me.subform1.Requery
Else
Me.Timer = Me.Timer - 1
End If
End Sub

in this way the subform1 will refresh every second.

Thanks alot for the reply.
Reply