Intellisoft Problem!

B

Bob

My Intellisoft box is not showing and giving me a chance to save changes,
this is my code on the Close and Save button any help would be
Great...............

Private Sub cmdClose_Click()
If Len([tbInvoiceDate]) = 0 Then
MsgBox "Please Insert The Invoice Date.", vbApplicationModal +
vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbHorseName]) = 0 Then
MsgBox "Please Select The Horse Name From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbGSTOptions]) = 0 Then
MsgBox "Please Select The GST Options From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If bModify = True Then
If MsgBox("Do You Want To Save?", vbQuestion +
vbApplicationModal + vbYesNo + vbDefaultButton1, "Intellisoft") = vbYes Then
If Me.OpenArgs = "ModifyOldInvoice" Then
CurrentProject.Connection.Execute "DELETE * FROM
tblDailyCharge WHERE InvoiceID=" & tbInvoiceID.value
tbInvoiceID.value
CurrentProject.Connection.Execute "DELETE * FROM
tblAdditionCharge WHERE InvoiceID=" & tbInvoiceID.value

subSetInvoiceValuesModifyMode
subSetInvoiceDetailsValues
recInvoice.Update

ElseIf Me.OpenArgs = "ModifyHoldingInvoice" Then
subSetInvoiceModifyItMdtValues
subSetInvoiceModifyItMdtDetailsValues
recInvoice_ItMdt.Update

Else
subSetInvoiceItMdtValues
subSetInvoiceItMdtDetailsValues
recInvoice_ItMdt.Update

End If

bModify = False
End If
End If
Set recInvoice = Nothing
Thanks in advance.........Bob Vance
 
B

Bob

Sorry I am a newbie, where would I look...Thanks Bob

Douglas J. Steele said:
How (and where) is the variable bModify declared? Where does it get set?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
My Intellisoft box is not showing and giving me a chance to save changes,
this is my code on the Close and Save button any help would be
Great...............

Private Sub cmdClose_Click()
If Len([tbInvoiceDate]) = 0 Then
MsgBox "Please Insert The Invoice Date.", vbApplicationModal +
vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbHorseName]) = 0 Then
MsgBox "Please Select The Horse Name From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbGSTOptions]) = 0 Then
MsgBox "Please Select The GST Options From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If bModify = True Then
If MsgBox("Do You Want To Save?", vbQuestion +
vbApplicationModal + vbYesNo + vbDefaultButton1, "Intellisoft") = vbYes
Then
If Me.OpenArgs = "ModifyOldInvoice" Then
CurrentProject.Connection.Execute "DELETE * FROM
tblDailyCharge WHERE InvoiceID=" & tbInvoiceID.value
tbInvoiceID.value
CurrentProject.Connection.Execute "DELETE * FROM
tblAdditionCharge WHERE InvoiceID=" & tbInvoiceID.value

subSetInvoiceValuesModifyMode
subSetInvoiceDetailsValues
recInvoice.Update

ElseIf Me.OpenArgs = "ModifyHoldingInvoice" Then
subSetInvoiceModifyItMdtValues
subSetInvoiceModifyItMdtDetailsValues
recInvoice_ItMdt.Update

Else
subSetInvoiceItMdtValues
subSetInvoiceItMdtDetailsValues
recInvoice_ItMdt.Update

End If

bModify = False
End If
End If
Set recInvoice = Nothing
Thanks in advance.........Bob Vance
 
D

Douglas J. Steele

Open the module in the VB Editor and do a Find on bModify. (Ctrl-F) Keep
looking until there are no more finds.

Somewhere you should find code along the lines of

Dim bModify As Boolean

(it may be Private or Public instead of Dim)

Where is that line of code?

Where is/are the line of codes that set a value for bModify?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
Sorry I am a newbie, where would I look...Thanks Bob

Douglas J. Steele said:
How (and where) is the variable bModify declared? Where does it get set?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
My Intellisoft box is not showing and giving me a chance to save
changes, this is my code on the Close and Save button any help would be
Great...............

Private Sub cmdClose_Click()
If Len([tbInvoiceDate]) = 0 Then
MsgBox "Please Insert The Invoice Date.", vbApplicationModal +
vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbHorseName]) = 0 Then
MsgBox "Please Select The Horse Name From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbGSTOptions]) = 0 Then
MsgBox "Please Select The GST Options From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If bModify = True Then
If MsgBox("Do You Want To Save?", vbQuestion +
vbApplicationModal + vbYesNo + vbDefaultButton1, "Intellisoft") = vbYes
Then
If Me.OpenArgs = "ModifyOldInvoice" Then
CurrentProject.Connection.Execute "DELETE * FROM
tblDailyCharge WHERE InvoiceID=" & tbInvoiceID.value
tbInvoiceID.value
CurrentProject.Connection.Execute "DELETE * FROM
tblAdditionCharge WHERE InvoiceID=" & tbInvoiceID.value

subSetInvoiceValuesModifyMode
subSetInvoiceDetailsValues
recInvoice.Update

ElseIf Me.OpenArgs = "ModifyHoldingInvoice" Then
subSetInvoiceModifyItMdtValues
subSetInvoiceModifyItMdtDetailsValues
recInvoice_ItMdt.Update

Else
subSetInvoiceItMdtValues
subSetInvoiceItMdtDetailsValues
recInvoice_ItMdt.Update

End If

bModify = False
End If
End If
Set recInvoice = Nothing
Thanks in advance.........Bob Vance
 
B

Bob

Option Explicit
Option Compare Database
Dim cnnStableAccount As Connection, recInvoice As ADODB.Recordset
Dim lngInvoiceID As Long, strExpressionOrgument As String, bModify As
Boolean, dtInvoiceDate As Date

Thanks Bob

Douglas J. Steele said:
Open the module in the VB Editor and do a Find on bModify. (Ctrl-F) Keep
looking until there are no more finds.

Somewhere you should find code along the lines of

Dim bModify As Boolean

(it may be Private or Public instead of Dim)

Where is that line of code?

Where is/are the line of codes that set a value for bModify?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
Sorry I am a newbie, where would I look...Thanks Bob

Douglas J. Steele said:
How (and where) is the variable bModify declared? Where does it get set?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


My Intellisoft box is not showing and giving me a chance to save
changes, this is my code on the Close and Save button any help would be
Great...............

Private Sub cmdClose_Click()
If Len([tbInvoiceDate]) = 0 Then
MsgBox "Please Insert The Invoice Date.", vbApplicationModal +
vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbHorseName]) = 0 Then
MsgBox "Please Select The Horse Name From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbGSTOptions]) = 0 Then
MsgBox "Please Select The GST Options From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If bModify = True Then
If MsgBox("Do You Want To Save?", vbQuestion +
vbApplicationModal + vbYesNo + vbDefaultButton1, "Intellisoft") = vbYes
Then
If Me.OpenArgs = "ModifyOldInvoice" Then
CurrentProject.Connection.Execute "DELETE * FROM
tblDailyCharge WHERE InvoiceID=" & tbInvoiceID.value
tbInvoiceID.value
CurrentProject.Connection.Execute "DELETE * FROM
tblAdditionCharge WHERE InvoiceID=" & tbInvoiceID.value

subSetInvoiceValuesModifyMode
subSetInvoiceDetailsValues
recInvoice.Update

ElseIf Me.OpenArgs = "ModifyHoldingInvoice" Then
subSetInvoiceModifyItMdtValues
subSetInvoiceModifyItMdtDetailsValues
recInvoice_ItMdt.Update

Else
subSetInvoiceItMdtValues
subSetInvoiceItMdtDetailsValues
recInvoice_ItMdt.Update

End If

bModify = False
End If
End If
Set recInvoice = Nothing
Thanks in advance.........Bob Vance
 
B

Bob

Found this To:
Private Sub cmdSave_Click()
If tbInvoiceDate.value = "" Or IsNull(tbInvoiceDate.value) = True Then
MsgBox "Date Could Not Be Null/Blank.", vbApplicationModal +
vbCritical + vbOKOnly
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

End Sub

Douglas J. Steele said:
Open the module in the VB Editor and do a Find on bModify. (Ctrl-F) Keep
looking until there are no more finds.

Somewhere you should find code along the lines of

Dim bModify As Boolean

(it may be Private or Public instead of Dim)

Where is that line of code?

Where is/are the line of codes that set a value for bModify?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
Sorry I am a newbie, where would I look...Thanks Bob

Douglas J. Steele said:
How (and where) is the variable bModify declared? Where does it get set?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


My Intellisoft box is not showing and giving me a chance to save
changes, this is my code on the Close and Save button any help would be
Great...............

Private Sub cmdClose_Click()
If Len([tbInvoiceDate]) = 0 Then
MsgBox "Please Insert The Invoice Date.", vbApplicationModal +
vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbHorseName]) = 0 Then
MsgBox "Please Select The Horse Name From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbGSTOptions]) = 0 Then
MsgBox "Please Select The GST Options From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If bModify = True Then
If MsgBox("Do You Want To Save?", vbQuestion +
vbApplicationModal + vbYesNo + vbDefaultButton1, "Intellisoft") = vbYes
Then
If Me.OpenArgs = "ModifyOldInvoice" Then
CurrentProject.Connection.Execute "DELETE * FROM
tblDailyCharge WHERE InvoiceID=" & tbInvoiceID.value
tbInvoiceID.value
CurrentProject.Connection.Execute "DELETE * FROM
tblAdditionCharge WHERE InvoiceID=" & tbInvoiceID.value

subSetInvoiceValuesModifyMode
subSetInvoiceDetailsValues
recInvoice.Update

ElseIf Me.OpenArgs = "ModifyHoldingInvoice" Then
subSetInvoiceModifyItMdtValues
subSetInvoiceModifyItMdtDetailsValues
recInvoice_ItMdt.Update

Else
subSetInvoiceItMdtValues
subSetInvoiceItMdtDetailsValues
recInvoice_ItMdt.Update

End If

bModify = False
End If
End If
Set recInvoice = Nothing
Thanks in advance.........Bob Vance
 
B

Bob

This one was in (General)
Option Compare Database
Option Explicit

Dim recInvoice_ItMdt As ADODB.Recordset
Dim recInvoice As ADODB.Recordset, dblGSTContentsValue As Double,
lngIntermediateID As Long
Dim dblGSTOptionsValue As Double
Dim bModify As Boolean, ynCheque As Boolean, lngInvoiceID As Long,
strExpressionOrgument As String
Dim sngGstPercentage As Single, recGSTOptions As ADODB.Recordset
Dim bLockFlag As Boolean

Bob said:
Found this To:
Private Sub cmdSave_Click()
If tbInvoiceDate.value = "" Or IsNull(tbInvoiceDate.value) = True Then
MsgBox "Date Could Not Be Null/Blank.", vbApplicationModal +
vbCritical + vbOKOnly
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

End Sub

Douglas J. Steele said:
Open the module in the VB Editor and do a Find on bModify. (Ctrl-F) Keep
looking until there are no more finds.

Somewhere you should find code along the lines of

Dim bModify As Boolean

(it may be Private or Public instead of Dim)

Where is that line of code?

Where is/are the line of codes that set a value for bModify?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
Sorry I am a newbie, where would I look...Thanks Bob

How (and where) is the variable bModify declared? Where does it get
set?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


My Intellisoft box is not showing and giving me a chance to save
changes, this is my code on the Close and Save button any help would
be Great...............

Private Sub cmdClose_Click()
If Len([tbInvoiceDate]) = 0 Then
MsgBox "Please Insert The Invoice Date.", vbApplicationModal +
vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbHorseName]) = 0 Then
MsgBox "Please Select The Horse Name From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbGSTOptions]) = 0 Then
MsgBox "Please Select The GST Options From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If bModify = True Then
If MsgBox("Do You Want To Save?", vbQuestion +
vbApplicationModal + vbYesNo + vbDefaultButton1, "Intellisoft") =
vbYes Then
If Me.OpenArgs = "ModifyOldInvoice" Then
CurrentProject.Connection.Execute "DELETE * FROM
tblDailyCharge WHERE InvoiceID=" & tbInvoiceID.value
tbInvoiceID.value
CurrentProject.Connection.Execute "DELETE * FROM
tblAdditionCharge WHERE InvoiceID=" & tbInvoiceID.value

subSetInvoiceValuesModifyMode
subSetInvoiceDetailsValues
recInvoice.Update

ElseIf Me.OpenArgs = "ModifyHoldingInvoice" Then
subSetInvoiceModifyItMdtValues
subSetInvoiceModifyItMdtDetailsValues
recInvoice_ItMdt.Update

Else
subSetInvoiceItMdtValues
subSetInvoiceItMdtDetailsValues
recInvoice_ItMdt.Update

End If

bModify = False
End If
End If
Set recInvoice = Nothing
Thanks in advance.........Bob Vance
 
D

Douglas J. Steele

Your original code is set to only show the "Do You Want To Save?" message
box if bModify equals True, yet you appear to have no code that sets it to
True. I'd say that's your first problem.

A potential second problem is that I doubt your code is going to stop data
from being saved even if the user answers No, assuming your form is bound to
its data source. Access will always save the data for bound forms unless you
explicitly tell it no to, and your code doesn't tell it not to (and even if
it did, it's not in the correct place: you'd need to put code in the form's
BeforeUpdate event)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
Found this To:
Private Sub cmdSave_Click()
If tbInvoiceDate.value = "" Or IsNull(tbInvoiceDate.value) = True Then
MsgBox "Date Could Not Be Null/Blank.", vbApplicationModal +
vbCritical + vbOKOnly
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

End Sub

Douglas J. Steele said:
Open the module in the VB Editor and do a Find on bModify. (Ctrl-F) Keep
looking until there are no more finds.

Somewhere you should find code along the lines of

Dim bModify As Boolean

(it may be Private or Public instead of Dim)

Where is that line of code?

Where is/are the line of codes that set a value for bModify?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bob said:
Sorry I am a newbie, where would I look...Thanks Bob

How (and where) is the variable bModify declared? Where does it get
set?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


My Intellisoft box is not showing and giving me a chance to save
changes, this is my code on the Close and Save button any help would
be Great...............

Private Sub cmdClose_Click()
If Len([tbInvoiceDate]) = 0 Then
MsgBox "Please Insert The Invoice Date.", vbApplicationModal +
vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbHorseName]) = 0 Then
MsgBox "Please Select The Horse Name From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If Len([cbGSTOptions]) = 0 Then
MsgBox "Please Select The GST Options From The List.",
vbApplicationModal + vbInformation + vbOKOnly, "Intellisoft"
Exit Sub
End If

If bModify = True Then
If MsgBox("Do You Want To Save?", vbQuestion +
vbApplicationModal + vbYesNo + vbDefaultButton1, "Intellisoft") =
vbYes Then
If Me.OpenArgs = "ModifyOldInvoice" Then
CurrentProject.Connection.Execute "DELETE * FROM
tblDailyCharge WHERE InvoiceID=" & tbInvoiceID.value
tbInvoiceID.value
CurrentProject.Connection.Execute "DELETE * FROM
tblAdditionCharge WHERE InvoiceID=" & tbInvoiceID.value

subSetInvoiceValuesModifyMode
subSetInvoiceDetailsValues
recInvoice.Update

ElseIf Me.OpenArgs = "ModifyHoldingInvoice" Then
subSetInvoiceModifyItMdtValues
subSetInvoiceModifyItMdtDetailsValues
recInvoice_ItMdt.Update

Else
subSetInvoiceItMdtValues
subSetInvoiceItMdtDetailsValues
recInvoice_ItMdt.Update

End If

bModify = False
End If
End If
Set recInvoice = Nothing
Thanks in advance.........Bob Vance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top