Results 1 to 12 of 12

Thread: [RESOLVED] It has been working fine for 3 months but ...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Resolved [RESOLVED] It has been working fine for 3 months but ...

    Hi,

    I have been using this application for 3 months. It was working fine till yesterday. But now it is not working. Showing runtime error '13' when I am trying to save the data (and it highlights the code which is shown in bold in the following code).

    The following is the code:

    VB Code:
    1. Private Sub cmdSave_Click()
    2.  
    3. If txtCustomerName.Text <> "" Then
    4.    
    5.   With rs
    6.  
    7.  .AddNew
    8.  
    9.  .Fields("CustomerName").Value = txtCustomerName.Text
    10.  .Fields("SalesPerson").Value = txtSalesPerson.Text
    11.  .Fields("InvoiceNumber").Value = txtInvoiceNumber.Text
    12. [B] .Fields("InvoiceDate").Value = CDate(txtInvoiceDate.Text)[/B]
    13.  .Fields("InvoiceAmount").Value = CCur(txtInvoiceAmount.Text)
    14.  .Fields("Description").Value = txtDescription.Text
    15.  .Fields("CreditPeriod").Value = CLng(txtCreditPeriod.Text)
    16.  .Fields("FileNumber").Value = txtFileNumber.Text
    17.  .Fields("City").Value = txtCity.Text
    18.  
    19. .Update
    20.  
    21. End With
    22.  
    23. Call Enable_FormControls
    24. Call Save_UpdateControls
    25. Call Instructions
    26. cmdSave.Enabled = False
    27.  
    28. Else
    29.  
    30. Call Enable_FormControls
    31. Call Save_UpdateControls
    32. Call Instructions
    33. cmdSave.Enabled = False
    34.  
    35. End If
    36. End Sub

    Thanks in advance.

    Regards,

    Seema_S

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: It has been working fine for 3 months but ...

    Has anyone changed the datatype of InvoiceDate field in the database? And have you checked what is there in txtInvoiceDate.Text?
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Re: It has been working fine for 3 months but ...

    Quote Originally Posted by Shuja Ali
    Has anyone changed the datatype of InvoiceDate field in the database? And have you checked what is there in txtInvoiceDate.Text?
    I am the one who is using this computer. I have not changed anything in this project. Just using to enter some data. What I have done is, installed some games on this computer, some of those causing error and not working. I have 4 tables in this database which has date fields in it. And all those causing the same error when saving the data.

    Seema_S

  4. #4
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: It has been working fine for 3 months but ...

    Did you change your date formats recently? Debug through the code and try writing this in the Immediate window
    VB Code:
    1. ?Cdate(txtInvoiceDate.Text)
    And do the same with other date text fields also.

    If you get an error then that means there is something wrong with the data that is present in the textbox.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: It has been working fine for 3 months but ...

    Sounds like some regional settings got changed - have you looked at that?

    Is your date/time appearing the same in the lower-right corner of the task bar when you hover over it?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Re: It has been working fine for 3 months but ...

    Quote Originally Posted by szlamany
    Sounds like some regional settings got changed - have you looked at that?

    Is your date/time appearing the same in the lower-right corner of the task bar when you hover over it?
    The following jpg file has some details. I have not changed any code recently.

    Regards,

    Seema_S
    Attached Images Attached Images  

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Re: It has been working fine for 3 months but ...

    Quote Originally Posted by seema_s
    The following jpg file has some details. I have not changed any code recently.

    Regards,

    Seema_S
    I am getting the following error (jpg) frequently since yesterday when I am trying to play games. Is this the error causing the application getting that error?

    Seema_S
    Attached Images Attached Images  

  8. #8
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: It has been working fine for 3 months but ...

    I don't think this will be the reason why you are getting an error in your VB App.

    Did you try what I suggested?
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Re: It has been working fine for 3 months but ...

    Quote Originally Posted by Shuja Ali
    I don't think this will be the reason why you are getting an error in your VB App.

    Did you try what I suggested?
    Hi,

    My all applications are having problem when trying to save them. Even some applications which doesn't have date value also saving fields as blank. I have re-installed the visual basic 6.0, but the problem is same.

    Regards,

    Seema_S
    Last edited by seema_s; Jul 12th, 2006 at 03:39 AM.

  10. #10
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: It has been working fine for 3 months but ...

    Well I am clueless as to what will cause this problem. Probably you installed something recently that screwed Windows. An Update or something similar to this.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Re: It has been working fine for 3 months but ...

    Quote Originally Posted by Shuja Ali
    Well I am clueless as to what will cause this problem. Probably you installed something recently that screwed Windows. An Update or something similar to this.

    Hi,

    Now it is working properly. The problem was with regional settings (date format). But still I don't know why those applicantion did not work which has only one txtbox (txtReminder) with string property.

    Thanks.

    Seema_S
    Last edited by seema_s; Jul 12th, 2006 at 05:50 AM.

  12. #12
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: [RESOLVED] It has been working fine for 3 months but ...

    dd/mm/yyyy is a date format that MS SQL does not like - was this ACCESS or MS SQL? I believe ACCESS also does not like that format.

    CDate() follows regional settings - so you are at risk of problems with CDate().

    I believe that the FORMAT() function can be told to force MM/DD/YYYY regardless of regional settings.

    I was burned by regional settings in our high school attendance application when the spanish teacher selected commas as decimal points instead of periods...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width