Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Intellisoft Problem!

Discussion in 'Information Technology' started by Bob, Jul 28, 2006.

  1. Bob

    Bob
    Expand Collapse
    Guest

    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
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikhs Face Problems While Carrying Kirpans In Khyber-Pakhtunkhwa - SikhSiyasat.Net Breaking News Jul 29, 2016
    "Dasam" Granth - A Look At The Core Problems Dasam Granth Oct 21, 2015
    Problems In Life Sikh Sikhi Sikhism Apr 13, 2015
    How can I make decent and useful friends and from where ?? most people have a problem with me Sikh Youth Oct 23, 2013
    The Problem with Taking Too Many Vitamins Health & Nutrition Oct 18, 2013

  3. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

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

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "Bob" <xxx@xx.xx> wrote in message news:e5aksf$s6m$1@lust.ihug.co.nz...
    > 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
    >
     
  4. Bob

    Bob
    Expand Collapse
    Guest

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

    "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:%23w5PpPegGHA.4304@TK2MSFTNGP05.phx.gbl...
    > How (and where) is the variable bModify declared? Where does it get set?
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no private e-mails, please)
    >
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e5aksf$s6m$1@lust.ihug.co.nz...
    >> 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
    >>

    >
    >
     
  5. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    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
    http://I.Am/DougSteele
    (no private e-mails, please)


    "Bob" <xxx@xx.xx> wrote in message news:e5anuu$1pk$1@lust.ihug.co.nz...
    > Sorry I am a newbie, where would I look...Thanks Bob
    >
    > "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    > news:%23w5PpPegGHA.4304@TK2MSFTNGP05.phx.gbl...
    >> How (and where) is the variable bModify declared? Where does it get set?
    >>
    >> --
    >> Doug Steele, Microsoft Access MVP
    >> http://I.Am/DougSteele
    >> (no private e-mails, please)
    >>
    >>
    >> "Bob" <xxx@xx.xx> wrote in message news:e5aksf$s6m$1@lust.ihug.co.nz...
    >>> 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
    >>>

    >>
    >>

    >
    >
     
  6. Bob

    Bob
    Expand Collapse
    Guest

    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" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:%23bQgtIfgGHA.1264@TK2MSFTNGP05.phx.gbl...
    > 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
    > http://I.Am/DougSteele
    > (no private e-mails, please)
    >
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e5anuu$1pk$1@lust.ihug.co.nz...
    >> Sorry I am a newbie, where would I look...Thanks Bob
    >>
    >> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    >> news:%23w5PpPegGHA.4304@TK2MSFTNGP05.phx.gbl...
    >>> How (and where) is the variable bModify declared? Where does it get set?
    >>>
    >>> --
    >>> Doug Steele, Microsoft Access MVP
    >>> http://I.Am/DougSteele
    >>> (no private e-mails, please)
    >>>
    >>>
    >>> "Bob" <xxx@xx.xx> wrote in message news:e5aksf$s6m$1@lust.ihug.co.nz...
    >>>> 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
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  7. Bob

    Bob
    Expand Collapse
    Guest

    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" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:%23bQgtIfgGHA.1264@TK2MSFTNGP05.phx.gbl...
    > 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
    > http://I.Am/DougSteele
    > (no private e-mails, please)
    >
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e5anuu$1pk$1@lust.ihug.co.nz...
    >> Sorry I am a newbie, where would I look...Thanks Bob
    >>
    >> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    >> news:%23w5PpPegGHA.4304@TK2MSFTNGP05.phx.gbl...
    >>> How (and where) is the variable bModify declared? Where does it get set?
    >>>
    >>> --
    >>> Doug Steele, Microsoft Access MVP
    >>> http://I.Am/DougSteele
    >>> (no private e-mails, please)
    >>>
    >>>
    >>> "Bob" <xxx@xx.xx> wrote in message news:e5aksf$s6m$1@lust.ihug.co.nz...
    >>>> 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
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  8. Bob

    Bob
    Expand Collapse
    Guest

    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" <xxx@xx.xx> wrote in message news:e5ausr$ed5$1@lust.ihug.co.nz...
    > 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" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    > news:%23bQgtIfgGHA.1264@TK2MSFTNGP05.phx.gbl...
    >> 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
    >> http://I.Am/DougSteele
    >> (no private e-mails, please)
    >>
    >>
    >> "Bob" <xxx@xx.xx> wrote in message news:e5anuu$1pk$1@lust.ihug.co.nz...
    >>> Sorry I am a newbie, where would I look...Thanks Bob
    >>>
    >>> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    >>> news:%23w5PpPegGHA.4304@TK2MSFTNGP05.phx.gbl...
    >>>> How (and where) is the variable bModify declared? Where does it get
    >>>> set?
    >>>>
    >>>> --
    >>>> Doug Steele, Microsoft Access MVP
    >>>> http://I.Am/DougSteele
    >>>> (no private e-mails, please)
    >>>>
    >>>>
    >>>> "Bob" <xxx@xx.xx> wrote in message news:e5aksf$s6m$1@lust.ihug.co.nz...
    >>>>> 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
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  9. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    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
    http://I.Am/DougSteele
    (no private e-mails, please)


    "Bob" <xxx@xx.xx> wrote in message news:e5ausr$ed5$1@lust.ihug.co.nz...
    > 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" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    > news:%23bQgtIfgGHA.1264@TK2MSFTNGP05.phx.gbl...
    >> 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
    >> http://I.Am/DougSteele
    >> (no private e-mails, please)
    >>
    >>
    >> "Bob" <xxx@xx.xx> wrote in message news:e5anuu$1pk$1@lust.ihug.co.nz...
    >>> Sorry I am a newbie, where would I look...Thanks Bob
    >>>
    >>> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    >>> news:%23w5PpPegGHA.4304@TK2MSFTNGP05.phx.gbl...
    >>>> How (and where) is the variable bModify declared? Where does it get
    >>>> set?
    >>>>
    >>>> --
    >>>> Doug Steele, Microsoft Access MVP
    >>>> http://I.Am/DougSteele
    >>>> (no private e-mails, please)
    >>>>
    >>>>
    >>>> "Bob" <xxx@xx.xx> wrote in message news:e5aksf$s6m$1@lust.ihug.co.nz...
    >>>>> 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
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  10. turniporange via AccessMonster.com

    Guest

    Did this work..Thanx

    Douglas J. Steele wrote:
    >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)
    >
    >> Found this To:
    >> Private Sub cmdSave_Click()

    >[quoted text clipped - 99 lines]
    >>>>>> Set recInvoice = Nothing
    >>>>>> Thanks in advance.........Bob Vance


    --
    Message posted via AccessMonster.com
    http://www.accessmonster.com/Uwe/Forums.aspx/access/200606/1
     

Share This Page