Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2004
    Location
    new york
    Posts
    28

    Question Unanswered: Need Help Please!

    Hi evry1, doin a database for school, almost finished, spent AGES on it and i am ecstatic because its amazing. Ive racked my brains and I just need help on this last thing. I have a sold checbox in my form. All i want is that when it is checked, a text box displaying the words SOLD in red to appear above the item's picture. Ive tried everything but cannot get anywhere. Help would be kindly appreciated,
    Cheers,
    Bob Simmons.

  2. #2
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    Hi Bob,

    Try this:

    in the AfterUpdate event of you checkbox control, do:

    If [checkbox name].Value=-1 then
    [Text Control name]="SOLD"
    [Text Control name].ForeColor=number of the color you want
    Else
    [Text Control name]="" 'unless you set the property of allowing null values to "No"
    [Text Control name].ForeColor=number of other color you want
    End If

  3. #3
    Join Date
    Dec 2004
    Location
    new york
    Posts
    28
    I still cant get it to work, thanks 4 ur help,
    I put in,
    Private Sub Option813_AfterUpdate()

    If [Check823].Value = -1 Then
    [Text821] = "SOLD"
    [Text821].ForeColor = 255
    Else
    [Text Control name] = "" 'unless you set the property of allowing null values to "No"
    [Text Control name].ForeColor = 255
    End If
    End Sub
    but still dusnt work, any suggestions?

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    try putting the code the
    Private Sub Form_Current()
    .........

    End Sub
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  5. #5
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    Hi,

    Don't put the code in the option event, but in the check event.

    I can guess you have choosen the option group control to make the checkboxes.

    Eliminate that. Choose the CheckBox Control only. Right click the control, give it a name, on the event procedure AfterUpdate put the code. You'll see that'll work.

    If you put the code like that in the option group event you will see nothing, because you are refering to the control as if it was disconnected from the group, and in your case it not. So eliminate the entire group and the checkboxes and choose the checkbox control only.

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    This may sound idiotic but why not use a label? Make a label above the pic with a caption of SOLD and hide it (set .Visible property to false oh and set the color to red). Then when your checkbox is checked merely make the label visible ...


    P.S. - I do this all the time with "NEW" labels, "PROCESSING" labels, and "LOADING" labels ... It's a good practice.
    Back to Access ... ADO is not the way to go for speed ...

  7. #7
    Join Date
    Dec 2004
    Location
    new york
    Posts
    28
    hi guys, thanx for ur help rely appreciate it, It now works but it only displays if i check a box and doesnt display on the already ticked records. once i check the box the sold sign appears on all of the pages whereas it should only be one that one record, and also the picture behind it automatically switches to clip mode instead of zoom

  8. #8
    Join Date
    Apr 2002
    Location
    Portugal
    Posts
    146
    Hi,

    The "SOLD" appears in all the records, because the control SOLD it's an unbound control.

    And it only appear once you tickle the checkbox, because the code is in the afterupdate event of your checkbox. Try to put the code in the FormCurrent event.

  9. #9
    Join Date
    Jan 2004
    Location
    Houston, TX
    Posts
    29
    This is an easy fix for the records that have already been checked in the past. Use the On Open event for the form. Paste the same code as the afterupdate event for the check box. This way, when the form opens is looks at the check box and executes code displaying the appropriate message depending on the value that already exists in the check box.

    Though as Miguel suggests you will need to bind the control to a field in the table. I would imagine this is something the should be captured anyhow for future reference and reporting.

Posting Permissions

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