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

Content Update

Status
Not open for further replies.

katiekat

Technical User
Jun 6, 2000
300
US
Hi!

I have 2 forms. One's a modular update form "add new", the other does pretty much everything else. If you add a reccord in the "Add New" form, the reccord doesn't show up until you close the other form and open it up again. How do I push the form to update the table on save of the "add new" form?

Spanks for the help!!

Kate Holy tek-tips batman!:-0
 
In the AfterUpdate event of your form issue a requery command of the other form. This solution assumes that the other form is ALWAYS open when the add new form is...

[tt]
Code Sample
[forms]![FormToShowDataIn].Requery
[/tt]

HTH Joe Miller
joe.miller@flotech.net
 
and if it isn't? Holy tek-tips batman!:-0
 
If it isn't then you need a function to test if it is open, and then if it is open issue the command. Here's a function to test if a form is loaded, place it in any module.

[tt]
'Examines open forms and returns true or false value
'depending on form being open or closed.
Function IsLoaded(ByVal strFormName As String) As Integer
IsLoaded = False
Dim frm As Form
For Each frm In Forms
If frm.Name = strFormName Then
IsLoaded = True
End If
Next frm
End Function
[/tt]

Now modify the code I gave you before to this:

[tt]
If IsLoaded("FormToShowDataIn") Then
[forms]![FormToShowDataIn].Requery
End if
[/tt]

That should do it!

Joe Miller
joe.miller@flotech.net
 
Thanks Joe! I really appreciate it!
:-D
Holy tek-tips batman!:-0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top