Results 1 to 11 of 11
  1. #1
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42

    Adding colorfield to entry

    Hi




    Is there a way to attach a color to an entry like this:

    Id - TeacherName - TeacherNameColorId



    I want in my report/form to see a color feild/little box in front of the teacherīs name, so he is easially recognized in a long report of studentīs names. Is that possible? I was thinking like a dropdown box in a form, where we add and enter the names of the teachers. Each time the teacherīs Id or name is used, the color will also be shown.



    Thx for your help

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Create a unbound Text Box next to the TeachersID Field(Combobox). Then on the afterEvent of the Combobox from where you will select the TeachersID.

    Let the unbound Text box be Text1 and the Comboox be Combo1

    ForeColor property is what you have to use:

    example:

    Select Case Me.Combo1
    Case is = 1
    Me.Text1.BackColor = RGB(0, 255, 0) 'Green
    Case is = 2
    Me.Text1.BackColor = RGB(255, 0, 0) 'Red
    Case is =3
    Me.Text1.BackColor= RGB(0, 255, 255) 'Blue
    End Select

    The Text Box coor will change and you will get the desired effect.

    if this solves you problem mark the thread solved.

  3. #3
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    is you problem solved if yes mark the thread solved.

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Please Mark the thread solved if you problem is solved.

  5. #5
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    I get an error, so I need to get this right:

    The code is to be inserted in the code-generator in visual bassic, right? And I go to properties for the combo1 and select procedure afterUpdate?

    The Teacherīs names are from a table, and includes on the names which are visible, but there is ofcourse a AutoID in the table. What did I do wrong?

  6. #6
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Yes I am attaching a sample mdb for you reference. A startup form Form1 will open as you open the database select a number on the combobox and see the background color of the text box change.

    If this solves your problem mark the thread solved.

  7. #7
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    Did it!!! I wasnīt aware of the Id to each teacher. I just chose the first name on the list, and it was the ID > 4, and it wasnīt in the code. Waky waky! :-D Thx for your help! You are indeed a great help to me! ;-)

  8. #8
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    How can I apply this color in the table of students? Is it easier to make a column more in the table of teacherīs, that is named "color"?

  9. #9
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Try formatting toolbar when you open your table. The toolbar gives you option to change background color and the text color. You were having some problem with Autonumber can you specify the problem.

    You basically want the Numbers to start from 1 and will increment by with every entry. Do you want the the Number to start from 1 again when you close you entry form and start another entry or you want the numbers to continue from the last number

    e.g. I enter 10 name then my Number increments Starting from 1 and ends on 10. When you close you data entry form and then again open it to make new entries do you want the numbers to start from 1 or 11.

  10. #10
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    Thx for color-help. ;-)

    Autonumber:
    When the teacher enters new students, the team has a number. When the students are entered, the teacher would save some time, if he doesnīt have to write a team-number for each student. It might as well be done invisible. So, the teacher enters new students. All students are member of the team "12". When he opens the form again, the teamnumber raised to "13" and he can enter new students. And so on.

  11. #11
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    I have attached a mdb file for you in the number increment thread check it out.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. data entry
    By ngeng4 in forum Forms
    Replies: 22
    Last Post: 03-18-2010, 07:12 PM
  2. Date entry
    By kellyd in forum Access
    Replies: 3
    Last Post: 09-24-2009, 02:23 PM
  3. Table Entry Sum
    By seraph in forum Access
    Replies: 5
    Last Post: 08-15-2009, 09:49 AM
  4. How do I exlude an entry (not delete)?
    By phantom in forum Access
    Replies: 1
    Last Post: 08-10-2009, 01:08 PM
  5. Entry into subform
    By lynchoftawa in forum Forms
    Replies: 1
    Last Post: 06-17-2009, 09:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums