Unload, Close, Deactivate. Which event is best?

Good afternoon 

Hoping for some quidance as to which event to use for an append query to a 
temp table.

A little background:
Currently the users enter all purchase order info via a main form (with PO 
Nbr and supplier info, etc..) and the purchase order details get entered into 
the subform.  The user enters amount ordered, amount received and a 
calculated field shows whether there are any backorders or not.  If there are 
any backorders, once they are received the user goes back into the Purchase 
order and changes the amount received.  All this works fine except we have no 
idea as to when the backorder was received and on which supplier ref nbr.  
They now want to track when the backorder was received, on what supplier ref 
nbr, qty etc... 

I was thinking that if there are any backorders, the backorder info could 
get copied to a temp table and when the backorders are received the user 
could bring up the ones he/she needed and update the backorder qty received 
with date received etc...

What I'm not sure of is where to put the code to do this.  Should it be on 
the OnUnload event, or OnClose or somewhere else?

Could someone please help me with this? 

As always, any assistance/wisdom is greatly appreciated.

Thanks kindly



0
Utf
3/18/2008 12:10:00 AM
access 16762 articles. 3 followers. Follow

2 Replies
722 Views

Similar Articles

[PageSpeed] 18

On Mon, 17 Mar 2008 17:10:00 -0700, Gabby Girl
<GabbyGirl@discussions.microsoft.com> wrote:

>What I'm not sure of is where to put the code to do this.  Should it be on 
>the OnUnload event, or OnClose or somewhere else?

None of the above, I'd say! What if the user has multiple orders to enter
(each of which might contain one or more backordered items)? The form might
not GET closed.

Without knowing the mapping from the form to the subforms, or what gets put
into the backorder table, all I can suggest is the mainform's AfterUpdate
event (fires when each mainform record - the order? - is written to disk), or
a command button Save.

Do be aware that the mainform record is saved whenever the user sets focus to
any subform control, and that each subform record is saved when you either
move to another record or to the mainform - I'm guessing you know that, but
the lurkers might not.
-- 

             John W. Vinson [MVP]
0
John
3/18/2008 1:34:25 AM
Hi John,

Thanks very much for your reply & expertise. 

I reread my question after I had posted it and gave my head a good shake and 
thought to myself "My God girl where is your head at?"  To explain a little 
further, there is a hidden check box (labeled LineComplete) in the subform 
(continuous) that is marked true (via code) if there are no backorders.  Once 
that PO details are entered the user can either press "cmdAdd" to add a new 
PO or "cmdClose" to exit PO's.  When the User presses either of these 
buttons, if all records in the subform are marked true LineComplete then a 
check box on the main form (labeled POComplete) is marked true.  I of course 
can add the code to both of those cmd buttons to copy the records for that PO 
that aren't marked complete to the temp table and then carry on from there.  
I hope I didn't get too long winded.

I really do appreciate you taking the time to help and if there is a 
better/easier way to do this I would welcome any advice you can give me.

Again Thanks and have a great evening





"John W. Vinson" wrote:

> On Mon, 17 Mar 2008 17:10:00 -0700, Gabby Girl
> <GabbyGirl@discussions.microsoft.com> wrote:
> 
> >What I'm not sure of is where to put the code to do this.  Should it be on 
> >the OnUnload event, or OnClose or somewhere else?
> 
> None of the above, I'd say! What if the user has multiple orders to enter
> (each of which might contain one or more backordered items)? The form might
> not GET closed.
> 
> Without knowing the mapping from the form to the subforms, or what gets put
> into the backorder table, all I can suggest is the mainform's AfterUpdate
> event (fires when each mainform record - the order? - is written to disk), or
> a command button Save.
> 
> Do be aware that the mainform record is saved whenever the user sets focus to
> any subform control, and that each subform record is saved when you either
> move to another record or to the mainform - I'm guessing you know that, but
> the lurkers might not.
> -- 
> 
>              John W. Vinson [MVP]
> 
0
Utf
3/18/2008 2:39:00 AM
Reply:

Similar Artilces:

Permissions / Closing MDB left open
I need to learn how to create - well, I'm not actually sure what I need to learn... Let me explain: I'm a surgical resident. I've been working on an Access MDB as a patient census - for day-to-day management including tables, queries, and forms that print based on room number or service. Everything is setup as needed in the local file. I've been working on the content of the database on and off for a year. Recently, before I can implement my project, I realized I have a very big challenge to overcome related to usage of the file. Now, to complicate my iss...

Closed account not so closed?
Hi All... I have (had) an investment account with E*Trade, which I have since closed. In MS Money 2006, I have it as "Account Is Closed", in the account list. There are a few weird things going on: 1. When I go into the account list, this account appears in gray with $0.00 next to it, but the "To Review" column has "Update in Progress" in it. This account is definately not part of my regular online updates (though when it was active, it was). 2. When I click into this account, 2 securities are listed. Neither one of them has Quantity or Cost Basis,...

Time Format and Unload Problem
I have a Textbox that is used for a Time Input I want the user to only be allowed to enter the info in the right format I.a. 12:30 I think the part that is important is the : in the middle. Also when the user clicks the command button An if statement is run to verify that all fields have been filled in. If not then a msgbox comes up stating that all info must be filled in. The problem is when the msgbox is closed then the unload me is run and the info that was put in is acted on I fixed that by making all variables = "" However the form still closes and needs to be run again. ...

Daylight Saving time changed events
Once again, the automatic switch to daylight saving time caused my one-day events to now span two days. This seems to happen somewhat randomly, not with all the one-day events. I seem to recall a patch that was supposed to fix this, but apparently it no longer works. I have way to many events to individually change each one, that and I do not know if the span went ahead or behind (e.g. for an event now covering the 9th and 10th, I do not know if the original date was the 9th or the 10th). How do I fix this? Windows XP sp2, Outlook 2003 sp3 -- Thank you, John Grego...

driver/dll load/unload behavior
Below is a portion of the debug output from an app being run in debug inside VS8. This is an unmanaged, VC++/MFC app. My question is why are wdmaud.drv and setupapi.dll loaded/unloaded multiple times during application startup? Does this only happen when executed in debug mode? If this also happens outside of the debugger (release), how can I tell and is there anything I can do to prevent it? Loaded 'C:\WINDOWS\system32\riched20.dll', No symbols loaded. Loaded 'C:\WINDOWS\system32\wdmaud.drv', No symbols loaded. Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbol...

Shared public folder calendar in Exchange: how best to have subscribers request vacation time?
I've set up a SBS 2008 Server for our small business (medical practice with four partner physicians). I'm creating a common calendar for partners' work schedules, using categories such as "on call," "vacation," "business meeting", etc. I'd like the subscribers to the calendar to be able to submit requests for time off, on-call changes, etc., to our office manager so that she needs to massage the requests as little as possible before posting them to the shared calendar. Can anyone suggest a streamlined workflow for this? Most subscrib...

In search of help identifying cause for application event 5000 or 5001
Many times a day, I am seeing one of the following two event log entries on a SharePoint 2007/MOSS 2007 machine "Error","5000","2/4/2010 7:59:47 AM","Windows SharePoint Services 3 Error Reporting","SERVER1","None","N/A","EventType ulsexception12, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4 stswel.dll, P5 12.0.6219.1000, P6 473bb9f2, P7 na, P8 5506f, P9 c0000005, P10 837l." or "Information","5001","2/3/2010 1:08:54 PM","Windows SharePoint Services 3 Error Reporting...

Hide / Unload Form
I am creating a userform from a macro I have but I need further functionality and extra buttons so an input box is no longer sufficient. I have started with the basics but am having trouble unloading or hiding the form once the OK button is clicked. See code below. Any help appreciated. Many thanks JayM Code: Private Sub cmdOK_Click() ' Inserts User Texts On Error GoTo errhandler resultx = txtUserText ' InputBox("Please enter the name of the Text Segment you wish to use :", "Enter Short Text") If resultx = "" T...

Event ID: 8331 Please Help
Hi, I can't fiqure out why this error floods my event viewer. Can't find resolution on knowledge base. Has some one experineced a similar problem? If so, do you know a resolution? Please Help Robert Event Type: Error Event Source: MSExchangeAL Event Category: Address List Synchronization Event ID: 8331 Date: 2/23/2004 Time: 11:32:32 AM User: N/A Computer: JSCSRV Description: The service threw an unexpected exception which was caught at f:\titanium\dsa\src\lra\abv_dg\lservagent.cpp(4511) For more information, click http://www.microsoft.com/contentredirect.asp. "Rob...

Hyperlink lost when workbook closed.
When I insert a URL as a hyperlink and then save the change I am able to get to the URL location. When I close the workbook and then open it at a later time I get the message "file error: data may have been lost" and sure enough the hyper link is gone. The blue underlined text is there but not the link. How can I correct this? Win 2k pro, excel 97 SR-2(n). Thanks ...

Trap Window.Close in CHtmlView
I have a class derived from CHtmlView and I want to prevent scripts that issue Window.Close from closing the main window. From what I've gathered using Google I want to use an eventsink. This is what I have so far: myHtmlView.h ----------- class myHtmlView : public CHtmlView { virtual void WindowClosing(BOOL IsChildWindow, BOOL* Cancel); DECLARE_EVENTSINK_MAP(); }; myHtmlView.C ------------ #include <exdispid.h> // DISPID_WINDOWCLOSING isn't in my exdispid.h #ifndef DISPID_WINDOWCLOSING #define DISPID_WINDOWCLOSING 263 #endif BEGIN_EVENTSINK_MAP(myHtmlView, CHtmlView) ...

Unload Me
Hi, I have a form loaded as Modal and on the Cancel Button event, I want it to close (or unload). Private Sub cmdAnnuler_Click() MsgBox "me.Name = " & Me.Name ' To make sure it is the right one. Unload Me End Sub I get an error: Run-time error '361': Can't load or unload this object What is the problem? Thanks -- Jac Tremblay Jac Tremblay wrote: >I have a form loaded as Modal and on the Cancel Button event, I want it to >close (or unload). > >Private Sub cmdAnnuler_Click() > MsgBox "me.Name = " & Me...

EXCEL 2002: How do I user/simulate a Timer event in Excel form
Hi Everyone I have a very long import procedure that's executed from a menu option. I would like to open an "Import" message form and animate a file flying from one side of the form (one folder) to the other side (another folder) until the import is completed. I can easily do it with other applications but find very hard to do with Excel forms, for example when I use Microsoft Access, I use a Timer event and move the file fractionally every few seconds to simulate the movement. However, Excel forms do not appear to have Timer events like Access or VB. I tried to simulate a ti...

CEdit EN_CHANGE event is triggered twice on changing selected content?
Hi, I have the following problem: Normally, the EN_CHANGE event of a CEdit control is triggered once, if the caret is set within the control and a key is pressed. But if the caret is not only set but the content of the control is selected, the event is triggered twice! The thing is, I open a dialog window on the EN_CHANGE event. If the content of the edit control is not selected when changing it, the control gets updated immediately before the dialog is opened. But if the content is selected and is changed, the dialog gets opened BEFORE the change of the edit control gets visible. AFTER closi...

imap server closed
I have got a message saying my imap server has been closed as it has been idle for too long, how do I reopen it? Ross <Ross@discussions.microsoft.com> wrote: > I have got a message saying my imap server has been closed as it has > been idle for too long, how do I reopen it? Just selecting one of the IMAP folders should reconnect. -- Brian Tillman ...

Close Form Without save design changes
When I open a specific form, I have an event that change the control captions name. When I close this form I would like to suppress the message: Do you want to save changes to the design of form "FORM1"? When I close via CLOSE BUTTON" upper right. Always shows this message. I don't want to save and I don't want to receive this message. What can I do? I can do this via button, but if i close from the "CLOSE BUTTON" upper right, the message comes again. Any help? Thanks jxp you can get rid of the CLOSE BUTTON (x button) in the right corner of the form'...

Auto Data Input from a Closed File
I want to import data from a closed Excel file into an active file. I know Walkenbach developed the GETVALUE UDF for that purpose, but I wonder if there are alternatives available. My goal is to have a user select the data required from a drop down box and that subsequently the correct data is imported into the correct area in the active worksheet. Thanks Jack Maybe you could have a hidden sheet with formulas that retrieve the values from that closed workbook. Then you could use Data|Validation and use the range on that worksheet as the source of the list. rvalasho wrote: > > ...

Returns entered from previous closed shift
When doing a close, how do you work off any returns entered from sales of previous closed shift? Since these returns are not from the current shift and it would not square off with current cashier shift at closing. On Sep 30, 7:04=A0am, RicoTowers <RicoTow...@discussions.microsoft.com> wrote: > When doing a close, how do you work off any returns entered from sales of > previous closed shift? =A0Since these returns are not from the current sh= ift > and it would not square off with current cashier shift at closing. Not sure what you are asking. All that matters from the sh...

Unload an addin
Hi! To uninstall an add-in, i'm using a .vbs script. My problem is when Excel is open and i try to "uninstall" the addin, i get an Access Denied error. objXL.AddIns("LMI!Comptable").Installed = False I think there's two ways to resolve my problem: 1- unload the add-in (possible?!?!?) 2-Check if Excel is open (possible?!??) and launch a warning to close it What would be the better solution and how can we do this? Thanks, Thierry Paradis. In VBA I would use workbooks("autosave.xla").Close Isn't there some equivalent of that in vbs ? Bas ...

For graphs how do i put a line of best fit?
I have an assignment that saYS I CAN PUT A LINE OF BEST FIT FOR MY GRAPH AUTOMATICALLY BUT I HAVE NO CLUE HOW TO Plot a line graph. Right-click anywhere on the line > Choose "Add TrendLine" then make the options in the dialog .. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "watevva" wrote: > I have an assignment that saYS I CAN PUT A LINE OF BEST FIT FOR MY GRAPH > AUTOMATICALLY BUT I HAVE NO CLUE HOW TO Fri, 20 Apr 2007 20:16:02 -0700 from watevva <watevva@discussions.microsoft.com>: > I have an assignment that saYS I CAN PUT...

Fire event once per second
What is the best way to fire an event every second? Create a timer. -- Jonathan Wood SoftCircuits http://www.softcircuits.com Available for consulting: http://www.softcircuits.com/jwood/resume.htm "Si" <si@hotmail.com> wrote in message news:EoR9f.25744$6i4.6224@newsfe7-gui.ntli.net... > What is the best way to fire an event every second? > Lookup WM_TIMER and CWnd::OnTimer on MSDN. -- Regards, Nish [VC++ MVP] "Si" <si@hotmail.com> wrote in message news:EoR9f.25744$6i4.6224@newsfe7-gui.ntli.net... > What is the best way to fire an event ...

Change opportunity statuscode after close
There is a way to change the statuscode of a opportunity after close(supported or not)? I can have some steps after close a opportunity... Thank you for pay attention []'s Vin�cius Pitta Lima de Ara�jo Once the status is closed the data becomes read only. You=20 will not be able to change this record via the SDK.=20 >-----Original Message----- >There is a way to change the statuscode of a opportunity=20 after >close(supported or not)? I can have some steps after=20 close a opportunity... > >Thank you for pay attention >[]'s >Vin=EDcius Pitta Lima de Ara=FAjo &...

Making Description filed in Closing Dialogs Business Required
Looking to see if there's a way of making the Description field in the Case Resolution closing dialog box mandatory. The attribute under the Case Resolution entity can't be ...

Problem loading and unloading dynamically a extension dll (MFC 7.0)
Hi I'm using a extension dll in a MFC exe dinamically. This is causing problems with deserialization of objects ! HMODULE h = AfxLoadLibrary(_T("my.dll")); // uses it AfxFreeLibrary(h); After this point, the m_pModuleState->m_classList of the exe CWinApp object is NULL and all CRuntimeClass information are lost ! Someone have a tip ? -- Leandro Gustavo Biss Becker http://go.to/leandrobecker "Leandro Becker" <becker@lit.cpdtt.cefetpr.br> wrote (abridged): > I'm using a extension dll in a MFC exe dinamically. > This is causing problems with des...

Unload UserForms
Hi, I am looking for a way to unload UserForms. I can unload one, but need all others to unload if vbYes is selected: Code used is: Private Sub CommandButton1_Click() Range("A5:D50", Range("A5:D50").End(xlDown)).sort Range("B50"), xlAscending Dim Res As VbMsgBoxResult Res = MsgBox("This will sort data into Red, Amber & Green", vbOKCancel) If Res = vbOK Then Unload UserForm5 End If End Sub UserForm1 is selected prior to UserForm5 as sort is an option on UF5 Any help gratefully received Many Thanks Cra...