multiple forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I've got a little problem.

I have this form called tester and another form called overwrite question
When I am in the tester form, and click on a list box three times it pops up
the overwrite question form which has a button called left, and one called
right.

When I push either button it closes the overwrite question form but what I
want to do is call a function in the tester form that is open before the
overwrite question form closes. Any ideas on how I can accomplish this.

Thanks in advance
Brian
 
Instead of closing the Overwrite Question form, make it invisible.
From the Main form, run your function, then close the Overwrite Questions
form.

Ideally, you are opening the Overwrite Question form in Dialog mode so no
code in your main form runs until that form no longer has focus.

You'll need to remove the Close Button from the properties sheet (set it to
No) so the user cannot actually close the form. They must use your close
button (which really just makes it invisible). While there are other ways to
close a form, most users will not use this (Ctrl+F4). If you feel like being
extra safe, trap for these keys in the form_KeyXXX events (the Form's
KeyPreview property will need to be set to True).

Something like this on the main form:

Dim f as Form
DoCmd.OpenForm "frmActualName", acNormal, , , , acDialog

'This next line will only fire after the frmActualName has gone invisible
Set f = Forms("frmActualName")
With f
'Run some code to check for values on the form.
'You may not need this, but in it's place add the code you do want to
run....
End With
'Close it
DoCmd.Close acForm, "frmActualName"

--
Troy

Troy Munford
Development Operations Manager
FMS, Inc.
www.fmsinc.com


Hi

I've got a little problem.

I have this form called tester and another form called overwrite question
When I am in the tester form, and click on a list box three times it pops up
the overwrite question form which has a button called left, and one called
right.

When I push either button it closes the overwrite question form but what I
want to do is call a function in the tester form that is open before the
overwrite question form closes. Any ideas on how I can accomplish this.

Thanks in advance
Brian
 
Back
Top