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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|