Welcome to SPN

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

Sign Up Now!

Beginner Using VBA Code Recordsource Object

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

  1. George Walsh

    George Walsh
    Expand Collapse
    Guest

    I want to understand how to use VBA code to gain programmatic control of the
    individual records of a field of data from a table in Access.

    In my pursuit of this knowledge, I have been reading the Access help topics
    relating to the recordset object - and I have been attempting to experiment
    with code using the Visual Basic code editor using a practice database I
    have created.

    I have a ToDo table with a date field representing the due date of the
    particular project described by the other fields associated with that
    record.

    All the records from this table are displayed in a datasheet on a sub-form.
    A main form contains the sub-form and has a field that displays the current
    date.

    I want to write code that executes upon the event of displaying the sub-form
    which evaluates the number of remaining days before the deadline, then I
    would like to have the specific records in the ToDo table which still have
    remaining days to go before the deadline - display with a background color
    that graduates from yellow to orange and eventually to red as the remaining
    days value becomes smaller.

    I used to write QuickBasic (VB) code, so I am familiar with the elements of
    VBA, generally. I also have lots of example databases and of course - the
    examples in the Access Help feature.

    Still, I am having problems. For example, I have recently been unable to
    debug the code I write by pressing F8. Sometimes it works, and in past
    efforts I have been able to use debug print and thereby display the values
    of my variables in the immediate window as my code executes. But sometimes
    the debug feature does not work; it's probably something I don't understand
    about the debug process. Is there some special requirement before the debug
    feature works? For example - does it only work when you write a Function?

    Also, if I use the Me.recordset command to reference the recordsource of the
    sub-form, how do I get the count of the number of records, and how do I
    display the ToDo date field's value for each record?

    Is there a good reference for learning the Access programming environment
    and how to gain a more refined control of the Access table data via writing
    code?

    Even with all the examples from other programmers and Access help, I still
    find there is such a vast amount of data to master about Access VBA Code -
    and that each piece I master takes a painfully slow process to acquire.

    Frequently, examples don't work, or require some unique adaptation that
    itself requires specialized knowledge to implement.

    It is especially distressing because I can do anything I want when I am
    using Microsoft Excel, I would like to have the same degree of expertise
    with Access. Why is Access so hard to master? Or is it?

    I know I could benefit from someone with expertise who is willing to set me
    on the right course and give me some direction. I am interested in knowing
    how others have gained their skills. Are there formal courses that are of
    benefit? How about a good book that doesn't reiterate all the simple basics
    about tables, queries, forms, reports, etc. I have already mastered the
    basics; it is the code writing that I specifically want to improve.
     
  2. Loading...

    Similar Threads Forum Date
    How To Follow Shabad Kirtan - For Beginners New to Sikhism Jul 18, 2009
    Sikh News Indian Greeting Card Company Asked To Apologize For Using Sikh Breaking News Jul 31, 2016
    UK Sikh blinded daughter-in-law in front of kids after accusing her of affair with Muslim Breaking News Jun 11, 2014
    Using Technology: online pesh? Questions and Answers Apr 2, 2014
    India SGPC Chief, Jathedars, Saints barred using red beacon cars Breaking News Jul 11, 2013

  3. Darly Pertuz

    Darly Pertuz
    Expand Collapse
    Guest

    Mensaje de prueba

    Saluti a tutto il team
    Darly

    "George Walsh" <Geo_Walsh@san.rr.com> escribió en el mensaje
    news:w_Heg.8583$uM4.4580@tornado.socal.rr.com...
    > I want to understand how to use VBA code to gain programmatic control of

    the
    > individual records of a field of data from a table in Access.
    >
    > In my pursuit of this knowledge, I have been reading the Access help

    topics
    > relating to the recordset object - and I have been attempting to

    experiment
    > with code using the Visual Basic code editor using a practice database I
    > have created.
    >
    > I have a ToDo table with a date field representing the due date of the
    > particular project described by the other fields associated with that
    > record.
    >
    > All the records from this table are displayed in a datasheet on a

    sub-form.
    > A main form contains the sub-form and has a field that displays the

    current
    > date.
    >
    > I want to write code that executes upon the event of displaying the

    sub-form
    > which evaluates the number of remaining days before the deadline, then I
    > would like to have the specific records in the ToDo table which still have
    > remaining days to go before the deadline - display with a background color
    > that graduates from yellow to orange and eventually to red as the

    remaining
    > days value becomes smaller.
    >
    > I used to write QuickBasic (VB) code, so I am familiar with the elements

    of
    > VBA, generally. I also have lots of example databases and of course - the
    > examples in the Access Help feature.
    >
    > Still, I am having problems. For example, I have recently been unable to
    > debug the code I write by pressing F8. Sometimes it works, and in past
    > efforts I have been able to use debug print and thereby display the values
    > of my variables in the immediate window as my code executes. But

    sometimes
    > the debug feature does not work; it's probably something I don't

    understand
    > about the debug process. Is there some special requirement before the

    debug
    > feature works? For example - does it only work when you write a Function?
    >
    > Also, if I use the Me.recordset command to reference the recordsource of

    the
    > sub-form, how do I get the count of the number of records, and how do I
    > display the ToDo date field's value for each record?
    >
    > Is there a good reference for learning the Access programming environment
    > and how to gain a more refined control of the Access table data via

    writing
    > code?
    >
    > Even with all the examples from other programmers and Access help, I still
    > find there is such a vast amount of data to master about Access VBA Code -
    > and that each piece I master takes a painfully slow process to acquire.
    >
    > Frequently, examples don't work, or require some unique adaptation that
    > itself requires specialized knowledge to implement.
    >
    > It is especially distressing because I can do anything I want when I am
    > using Microsoft Excel, I would like to have the same degree of expertise
    > with Access. Why is Access so hard to master? Or is it?
    >
    > I know I could benefit from someone with expertise who is willing to set

    me
    > on the right course and give me some direction. I am interested in

    knowing
    > how others have gained their skills. Are there formal courses that are of
    > benefit? How about a good book that doesn't reiterate all the simple

    basics
    > about tables, queries, forms, reports, etc. I have already mastered the
    > basics; it is the code writing that I specifically want to improve.
    >
    >
     

Share This Page