If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
forms pop up form
If the contents of a field is blank (but the record
exists), I wish to ensure that a sub form set to pop up is not opened when i change the contents from blank to some character(s). However if the original contents are not blank i wish to have the popup open if the entry is altered(changed), how??? If the control that is being changed is a bound control, i have been told i can use controls OldValue property to see if the control was previously blank, if not, then pop- up theform. This could be done in the BeforeUpdate or AfterUpdate event of the control. The BeforeUpdate event will gives methe option to Cancel the update, if idesire. The problem is my experienece in the progamming side is weak at best and am not sure quite how to program this, can someone please give me a little bit of guidance on how to actually program this with the before update property |
#2
|
|||
|
|||
Pat, you should reply to the previous message to try to keep the thread
together in one spot. It makes it easier for everyone to follow. Sample Code: If Nz(Me.txtMyTextbox.OldValue, "") "" And Me.txtMyTextbox.OldValue Me.txtMyTextbox.Value Then DoCmd.OpenForm "frmMyPopup",,,,,acDialog End If The "And" part of the check could probably be skipped. Since the Before/After Update event is firing, the control was changed. The only thing this would check for was if the user retyped what was already there. Use the parameters you need in the OpenForm call. Which ones you need will depend on what you're wanting your popup form to do. The Nz function will change a Null value to the indicated value, in this case a zero length string (""). I did this because I don't know if you are using zero length strings in your table. Null would be more common, but this will handle either. To get to the event procedure, open the Properties sheet for the control and go to the Events tab. Set the box next to the Before Update or After Update event to [Event Procedure]. Next, click the ... button and it will take you to the code editor with the first and last line of the procedure entered for you. -- Wayne Morgan MS Access MVP "patrick" wrote in message ... If the contents of a field is blank (but the record exists), I wish to ensure that a sub form set to pop up is not opened when i change the contents from blank to some character(s). However if the original contents are not blank i wish to have the popup open if the entry is altered(changed), how??? If the control that is being changed is a bound control, i have been told i can use controls OldValue property to see if the control was previously blank, if not, then pop- up theform. This could be done in the BeforeUpdate or AfterUpdate event of the control. The BeforeUpdate event will gives methe option to Cancel the update, if idesire. The problem is my experienece in the progamming side is weak at best and am not sure quite how to program this, can someone please give me a little bit of guidance on how to actually program this with the before update property |
#3
|
|||
|
|||
thankyou for your assistance, have solved the problem
with your idea pat -----Original Message----- If the contents of a field is blank (but the record exists), I wish to ensure that a sub form set to pop up is not opened when i change the contents from blank to some character(s). However if the original contents are not blank i wish to have the popup open if the entry is altered(changed), how??? If the control that is being changed is a bound control, i have been told i can use controls OldValue property to see if the control was previously blank, if not, then pop- up theform. This could be done in the BeforeUpdate or AfterUpdate event of the control. The BeforeUpdate event will gives methe option to Cancel the update, if idesire. The problem is my experienece in the progamming side is weak at best and am not sure quite how to program this, can someone please give me a little bit of guidance on how to actually program this with the before update property . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems with custom forms not displaying, (using outlook form ins | Katherines01 | Contacts | 1 | January 13th, 2005 02:25 PM |
Link subforms to show active record | Timboo | New Users | 4 | December 23rd, 2004 09:59 AM |
open a form through a subform in access 2000 | Tammy | Setting Up & Running Reports | 12 | October 22nd, 2004 02:43 PM |
datasheet forms open in form mode from the Switchboard | Paul James | Using Forms | 5 | July 13th, 2004 06:51 AM |
Populate two+ fields on a Form, based on a pop up form's record | Michael Miller | Using Forms | 0 | June 9th, 2004 02:56 PM |