coolcatkelso
Registered User.
- Local time
- Today, 00:45
- Joined
- Jan 5, 2009
- Messages
- 279
Hiya
I have 2 forms - Workorders by Customers and Payments
The workorder by customer is a brief summery of previous workorders, contains current account balance etc
The payment form is as it is.. Contains the Amount to be paid, payment method and WorkorderID (Related)
I have a field on the Workorder by Customer form that should display the amount been paid. Before this displays any numbers, obvisouly you need to create a workorder..
Once the workorder has been created, You should see the amount due,, This works perfectly
Problem:
In order for me to display the unpaid accounts and the current account balance on the Summery page, I have to goto the payments form and enter ?0.00 as the amount paid. Here is the code behind that form
Is there a way I can do this automattically? For example
Let;s say we just created a new workorder, I click on Print Invoice and Print Workorder (Tradesman Copy) then Close the workorder... ONCLOSE something like this
Payment Form
WorkorderID: 192
PaymentMethod: Other
PaymentDate: 10 Dec 2009
PaymentAmount: ?0.00
Is this poss?
Cheers CCK
________
MOTORCYCLE TIRES
I have 2 forms - Workorders by Customers and Payments
The workorder by customer is a brief summery of previous workorders, contains current account balance etc
The payment form is as it is.. Contains the Amount to be paid, payment method and WorkorderID (Related)
I have a field on the Workorder by Customer form that should display the amount been paid. Before this displays any numbers, obvisouly you need to create a workorder..
Once the workorder has been created, You should see the amount due,, This works perfectly
Problem:
In order for me to display the unpaid accounts and the current account balance on the Summery page, I have to goto the payments form and enter ?0.00 as the amount paid. Here is the code behind that form
Code:
Option Compare Database
Option Explicit
Private Sub Form_Open(Cancel As Integer)
If Not IsLoaded("Workorders by Customer") Then
MsgBox "Open the Payments form using the Payments button on the Workorders by Customer form."
Cancel = True
End If
End Sub
Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
Me.Requery
Exit_Form_Activate:
Exit Sub
Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
On Error GoTo Err_Form_BeforeInsert
Me![PaymentDate] = Date
Me![PaymentAmount] = [Forms]![Workorders by Customer]![Workorders by Customer Subform].Form![Amount Due]
Exit_Form_BeforeInsert:
Exit Sub
Err_Form_BeforeInsert:
MsgBox Err.Description
Resume Exit_Form_BeforeInsert
End Sub
Private Sub PaymentMethodID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub PaymentMethodID_AfterUpdate()
On Error GoTo Err_PaymentMethodID_AfterUpdate
If Not IsNull(Me![PaymentMethodID]) Then
If Me![PaymentMethodID].Column(2) = True Then
Me![PaymentMethod] = [Forms]![Workorders by Customer]![FirstName] & " " & [Forms]![Workorders by Customer]![LastName]
End If
End If
Exit_PaymentMethodID_AfterUpdate:
Exit Sub
Err_PaymentMethodID_AfterUpdate:
MsgBox Err.Description
Resume Exit_PaymentMethodID_AfterUpdate
End Sub
Private Sub PaymentMethodID_DblClick(Cancel As Integer)
On Error GoTo Err_PaymentMethodID_DblClick
Dim lngPaymentMethodID As Long
If IsNull(Me![PaymentMethodID]) Then
Me![PaymentMethodID].Text = ""
Else
lngPaymentMethodID = Me![PaymentMethodID]
Me![PaymentMethodID] = Null
End If
DoCmd.OpenForm "Payment Methods", , , , , acDialog, "GotoNew"
Me![PaymentMethodID].Requery
If lngPaymentMethodID <> 0 Then Me![PaymentMethodID] = lngPaymentMethodID
Exit_PaymentMethodID_DblClick:
Exit Sub
Err_PaymentMethodID_DblClick:
MsgBox Err.Description
Resume Exit_PaymentMethodID_DblClick
End Sub
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
DoCmd.Close
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Is there a way I can do this automattically? For example
Let;s say we just created a new workorder, I click on Print Invoice and Print Workorder (Tradesman Copy) then Close the workorder... ONCLOSE something like this
Payment Form
WorkorderID: 192
PaymentMethod: Other
PaymentDate: 10 Dec 2009
PaymentAmount: ?0.00
Is this poss?
Cheers CCK
________
MOTORCYCLE TIRES
Last edited: