Find Record in another open form and Close Form with call 
Author Message
 Find Record in another open form and Close Form with call

I have 2 forms ( Among many others that are not relevant)

(1) Form [Person Main] and (2)Form [Add/Edit Person]

A/E Person can be opened from Person Main as well as from other
places.

I would like to Find the Record that I just entered in Add/Edit Person
on Person Main and then Close Add/Edit Person.  (prefferably run this
all from 1 button or macro)

Any Help is appreciated.



Wed, 10 Aug 2005 05:25:47 GMT  
 Find Record in another open form and Close Form with call

Quote:

> I have 2 forms ( Among many others that are not relevant)

> (1) Form [Person Main] and (2)Form [Add/Edit Person]

> A/E Person can be opened from Person Main as well as from other
> places.

> I would like to Find the Record that I just entered in Add/Edit Person
> on Person Main and then Close Add/Edit Person.  (prefferably run this
> all from 1 button or macro)

> Any Help is appreciated.

If you can code....

Assumes there is a field PersonID and it is type numeric/long

Add a statement at the declaration part of the form's module
Dim lngID As Long

In the forms AfterUpdate event enter
    lngID = Me.PersonID

In the forms OnClose event enter
    If lngID <> 0 Then
        Dim rst As Recordset
        Set rst = Forms!PersonMain.Recordsetclone
        rst.FindFirst "[PersonID] = " & lngID
        If not rst.nomatch then
            Forms!PersonMain.bookmark = rst.bookmark
        endif
        set rst = Nothing
    endif

Code like the above should provide a starting point.  If you don't know
what some of those things mean...recordsetclone, recordset, findfirst,
nomatch then check on-line help.



Thu, 11 Aug 2005 00:38:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Closing an open form from calling form

2. Closing a form when other form is opening but reopening when all forms closed

3. Opening form 2 from form 1 - what form/event to close form 1

4. Solution Found:Open new form to same record as old form

5. Macro in Access:find record in new form based field in a diff open form

6. Solution Found:Open new form to same record as old form

7. Refresh form then go back to specific record on subform when closing a second form form

8. On close, call a procedure that exists in another open form

9. Opened form cannot find calling Subform to return a value

10. How to solve the error when a main form calls other form with add/remove records


 
Powered by phpBB® Forum Software © phpBB Group