Results 1 to 4 of 4

Thread: old/new value

  1. #1
    Join Date
    Apr 2004
    Posts
    11

    Unanswered: old/new value

    I'm developing a program using microsoft access as the frontend and mySQL as the backend. I'm having a hard time in storing values using variables... I use a textbox that has the value of the generated system date/time which is also my primary key. The scenario is that i want to store the value of that date/time in a variable which will hold its value and will not change whenever a new record is added. I need it so that it can be the reference of the new record for the previous record. Thank You

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    Either declare your variable at the module level or in the procedure using the static declartion. i.e.

    Private strDateTime as String

    or

    Static strDateTime as String

    Here is the line to store the variable:
    strDateTime = TextboxDateTime
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  3. #3
    Join Date
    Apr 2004
    Posts
    11

    declaration of static value

    I really appreciate that you reply immediately to my problem but I have this problem that I think you'll be the one to help me. You've given me this declaration: Static strDateTime as String
    Here is the line to store the variable:
    strDateTime = TextboxDateTime

    I've already try this declaration before and what happens is that its store the value of the TextboxDateTime but when I add a new record, the value of the strDateTime becomes null and it doesn't retain the value of the first strDateTime.

    What I want is that when I add a new record, the value will retain to the strDateTime so that I can track the exact record that have the same value of the variable strDateTime. When it happens I can already change the value of the TextboxStatus of that specific record through the use of using the strDateTime as my reference. Can u please help me to find a way to solve this problem. Thank you so much! Hope you will still reply as soon as possible

  4. #4
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    It could be that strDateTime is being set to the bound TextBox. What you want is just to store the value. Try this instead

    strDateTime = TextboxDateTime.Text
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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