Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Controlled Clos...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 30426 of 31576
Post > Topic >>

Controlled Close with the "x" button and subform - is it hopeless?

by Kelii <keliie@[EMAIL PROTECTED] > Jun 2, 2008 at 09:22 AM

I've been beating my head against this problem for the last several
days, and I haven't found a decent solution yet. So I'm turning to the
group for some moral sup****t or better yet some answers.

Background:
I want the user to be able to close the form by using the "x" button
in the window title bar, I do not want to disable this. I have found a
nice solution in the Access Developer's Handbook that disables the
"x", however I am hoping to avoid using this solution since I like
having the "x" available to the user.

The form that needs the Controlled Close has a subform in datasheet
view; the subform is linked to the main form using the primary /
foreign key.

My question:
Under this scenario, has anybody made the controlled close to work? If
so, what is the general coding strategy?

I've gone through several iterations of code, here is a mock up of
where I've ended; btw it doesn't work very well, several errors result
in akward form handling.

Form_Load
'Nothing here related to controlled close

Form_Current
'Nothing here either

Form_BeforeUpdate
'Check for empty form
'If empty, exit sub
'Validate form
'If invalid Cancel = True, Exit Sub

Form_Unload
'Call Form_BeforeUpdate
'If invalid form then Cancel = True
'Repopulate form with user input
'Exit Sub

Function ValidateForm
'Check for empty form
'Various error checking
'Check for empty subform (note: user cannot access subform until all
required fields in
'parent form are completed
'Various error checking
'If invalid, returns False and sets mod variable strError to text
describing error

Form_Error
'If incomplete form error (2169) then
'Msgbox allow user to Save ('yes'), Not Save ('no'), or Cancel close
('cancel')
'If user wants to continue editing current record, then
'Prompt user with error msg from mod variable strError
'And set variables up to repopulate form with user input in Form_Unload
 




 4 Posts in Topic:
Controlled Close with the "x" button and subform - is it hopeles
Kelii <keliie@[EMAIL P  2008-06-02 09:22:59 
Re: Controlled Close with the "x" button and subform - is it
The Frog <Mr.Frog.to.y  2008-06-04 00:40:02 
Re: Controlled Close with the "x" button and subform - is it
Kelii <keliie@[EMAIL P  2008-06-04 17:39:32 
Re: Controlled Close with the "x" button and subform - is it
Roger <lesperancer@[EM  2008-06-05 01:17:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 23:12:48 CST 2008.