In tblHorseDetails I have a 4 Fields
[HorseID] Number
[OwnerID] Number
[OwnerPercent] Number
[Invocing] Yes/No, (Check Box)
Effectively you set your horse up with one or more Owners with there percent
in that 1 Horse
I am trying to do is that when that record has a False in Invoicing it will
not create an Invoice
Below is the Code for Distributing the Invoice at the end of the month
Or do you think it has to been done in subSetInvoiceValues 16 row down
Any help would be much appreciated...............Bob
Private Sub cmdSave_Click()
With recInvoice
Dim recHorseOwners As New ADODB.Recordset, dblOwnerPercentAmount As
Double
Dim dblTotal As Double, dblGSTContentsValue As Double
recHorseOwners.Open "SELECT OwnerID,OwnerPercent FROM
tblHorseDetails" _
& " WHERE HorseID=" _
& val(tbHorseID.value) & " AND OwnerID > 0 ORDER BY OwnerID ",
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
If recHorseOwners.EOF = True And recHorseOwners.BOF = True Then
recHorseOwners.Close
Set recHorseOwners = Nothing
MsgBox "This Horse Has No Client Select, [CLOSE] " & vbCrLf &
vbCrLf & " Go to Horses and enter a Client before Distributing.",
vbApplicationModal + vbNo + vbInformation
Exit Sub
End If
If MsgBox("Do You Want To Distribute?", vbQuestion + vbApplicationModal
+ vbYesNo + vbDefaultButton1, "Intellisoft") = vbYes Then
recInvoice.AddNew
subSetInvoiceValues
recInvoice.Update
subDeleteInvoiceItmdt
subBlankForm
lbOwnerlist1.value = ""
lbOwnerlist1.RowSource = ""
lbOwnerlist1.SetFocus
cmdSave.Enabled = False
bModify = False
End If
Forms!frmModify![lstModify] = Null
Form_frmModify.lstModify.Requery
End With
Bob V - 15 Jan 2008 01:27 GMT
Ok Ive worked out it must be [subSetInvoiceValues] so somewhere I have to
add Invocing = True
This is part of the subSetInvoiceValues that needs changing
Thanks if you can help............Bob
recHorseOwners.Open "SELECT OwnerID,OwnerPercent FROM tblHorseDetails" _
& " WHERE HorseID=" _
& val(tbHorseID.value) & " AND OwnerID > 0 ORDER BY OwnerID ",
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
> In tblHorseDetails I have a 4 Fields
> [HorseID] Number
[quoted text clipped - 51 lines]
> Form_frmModify.lstModify.Requery
> End With
Bob V - 15 Jan 2008 01:44 GMT
YES YES YES I got it
recHorseOwners.Open "SELECT OwnerID,OwnerPercent FROM tblHorseDetails" _
& " WHERE HorseID=" _
& val(tbHorseID.value) & " AND OwnerID > 0 AND Invoicing = True
ORDER BY OwnerID ", CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
:) :) :) .........................Bob
> Ok Ive worked out it must be [subSetInvoiceValues] so somewhere I have to
> add Invocing = True
[quoted text clipped - 61 lines]
>> Form_frmModify.lstModify.Requery
>> End With
Bob V - 15 Jan 2008 05:19 GMT
When I distribute 1 Invoice at a time it works PERFECTLY but when I use this
other control code which Distributes all my Invoices at once:
If nRtnValue = vbYes Then
DoCmd.Hourglass True
subSetInvoiceValues
Application.SysCmd acSysCmdSetStatus, "Process is completed."
Application.SysCmd acSysCmdClearStatus
DoCmd.Hourglass False
Me.lstModify.Requery
I am getting an error on [variable not defined] on tbHorseID
Any help please!!..............Bob
> YES YES YES I got it
> recHorseOwners.Open "SELECT OwnerID,OwnerPercent FROM tblHorseDetails" _
[quoted text clipped - 69 lines]
>>> Form_frmModify.lstModify.Requery
>>> End With
Bob V - 15 Jan 2008 09:37 GMT
Thanks Guys All DONE (Funniest Post Ever)
Had the wrong Code, Did it all myself :) :) :)
Regards Bob
> When I distribute 1 Invoice at a time it works PERFECTLY but when I use
> this other control code which Distributes all my Invoices at once:
[quoted text clipped - 81 lines]
>>>> Form_frmModify.lstModify.Requery
>>>> End With