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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Re-Assign Calculated field



 
 
Thread Tools Display Modes
  #1  
Old January 26th, 2009, 12:15 AM posted to microsoft.public.access.gettingstarted
Project Coordinator
external usenet poster
 
Posts: 3
Default Re-Assign Calculated field

I have creat database to track project costs. Occasionally invoices do not
match purchase orders because vendors send in more mterial or close enough
quantities. I would like to be able to check box (yes/no) that when checked
yes changes the calculated to $0.00 showing the invoice closed. Don't have a
clue how to do it. Thanks in advance for any help.
  #2  
Old January 26th, 2009, 04:30 PM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Re-Assign Calculated field

Hi

I assum you have a form with
Text box named txtCalculatedControl
Tckbox name cbxInvoiceClosed

Open your form in design view
Open the properties box for cbxInvoiceClosed

On the afterUpdate event put this


Private Sub cbxInvoiceClosed_AfterUpdate()
Dim msg, style, title, ctext, responce, mystring
Dim stDocName As String
Dim stLinkCriteria As String
If Me.cbxInvoiceClosed = -1 Then
msg = "Are you sure you want to close this invoice" & vbCrLf & "and
reset the amount to 0 ?"
style = vbYesNo
title = "Close Invoice"
responce = MsgBox(msg, style, title)
If responce = vbYes Then
Me.txtCalculatedControl = 0
End If
End If
End Sub




Hope this helps




--
Wayne
Trentino, Italia.



"Project Coordinator" wrote:

I have creat database to track project costs. Occasionally invoices do not
match purchase orders because vendors send in more mterial or close enough
quantities. I would like to be able to check box (yes/no) that when checked
yes changes the calculated to $0.00 showing the invoice closed. Don't have a
clue how to do it. Thanks in advance for any help.

  #3  
Old January 28th, 2009, 06:05 PM posted to microsoft.public.access.gettingstarted
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default Re-Assign Calculated field

If we take the Orders form in the sample Northwind database as an example
you'll see that its Total control has as its ControlSource property the
following expression:

=[Subtotal]+[Freight]

If a Boolean (Yes/No) field IsClosed is added to the underlying Orders table
and a check box on the form is bound to it, amending the expression to:

=([Subtotal]+[Freight])*IIf([IsClosed],0,1)

will set the value to zero if the check box is checked, and to the actual
total of the order if not. It would be done in exactly the same way for an
invoice.

Ken Sheridan
Stafford, England

"Project Coordinator" wrote:

I have creat database to track project costs. Occasionally invoices do not
match purchase orders because vendors send in more mterial or close enough
quantities. I would like to be able to check box (yes/no) that when checked
yes changes the calculated to $0.00 showing the invoice closed. Don't have a
clue how to do it. Thanks in advance for any help.


 




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


All times are GMT +1. The time now is 05:17 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.