A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update once form input entered



 
 
Thread Tools Display Modes
  #1  
Old September 27th, 2004, 05:26 AM
external usenet poster
 
Posts: n/a
Default Update once form input entered

Hi All

I have a number of tables, queries, forms and reports set
up. Users will firstly enter customer details into one
form then enter their order and payment method into 2
other forms. These orders should then be viewed on
another form (looks like a calendar).

If I have all 4 forms open each piece of new data entered
(eg. new customer name, new order # etc) does not flow
through to the other forms. How can I achieve this
without having to open and close forms all day???

Please help
Thanks
  #2  
Old September 27th, 2004, 06:01 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Use the AfterUpdate and AfterDelConfirm events of all forms to notify the
other forms about the changes.

Part of the struggle is that at the time you are developing each form, you
don't know which other forms or combo boxes might depend on it. What we do,
therefore, is to create a function in a general module, call it from all the
forms we create, and actually fill in the details of the function once all
forms in developed and you know which ones depend on which other ones.

Every form's AfterUpdate event procedure contains:
Call NotifyCombos(Me)
and every form's AfterDelConfirm event procedure contains:
Call NotifyCombos(Me, Status)

In the standard module, is the function that sorts it out with a huge Select
Case structure. This makes it a big function, but we find it easier to
maintain.

Public Function NotifyCombos(frmSource As Form, _
Optional iStatus as Integer = acDeleteOK)
If iStatus = acDeleteOk Then
Select Case frmSource.Name
Case "frmCustomer" 'This is the form that was updated.
If IsLoaded("frmOrder") Then 'This is the one that needs
requerying.
Forms("frmOrder")!CustomerID.Requery
End If
Case "frmOrder"
'requery whatever
Case Else
Debug.Print "NotifyCombos() not handling " & frmSource.Name
End Select
End If
End Sub

Note: Copy the IsLoaded() function from the Utility module in Northwind, or
in A2000 and later use:
If CurrentProject.AllForms("frmCustomer").IsLoaded Then

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
...

I have a number of tables, queries, forms and reports set
up. Users will firstly enter customer details into one
form then enter their order and payment method into 2
other forms. These orders should then be viewed on
another form (looks like a calendar).

If I have all 4 forms open each piece of new data entered
(eg. new customer name, new order # etc) does not flow
through to the other forms. How can I achieve this
without having to open and close forms all day???

Please help
Thanks



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Protect clears all previously entered data Scott Schaffer General Discussion 4 August 12th, 2004 08:53 PM
Default values to load up automatically in a form based on value entered in another form Anthony Dowd Using Forms 8 August 12th, 2004 08:53 AM
dlookup miaplacidus Using Forms 9 August 5th, 2004 09:16 PM
Need help! Parameter update query to form Le Tran New Users 7 June 8th, 2004 06:26 PM
Update a table and close a form after a report runs... Jacqueline Setting Up & Running Reports 0 May 19th, 2004 06:59 PM


All times are GMT +1. The time now is 10:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.