Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2003
    Location
    Is
    Posts
    21

    Unanswered: New Buttons on Access...

    I didnt succed to change the colors of regular Pushbuttons on Access form. So I made a new label then added an event and on the event i changed the color and i want to change it back.

    1\ There is a command like deelay or timer so i will do a delay and then i'll chnge the color Back ??

    2\ Where can i Get Extra Buttons For access?

    I am searching for other way instead putting a bmp image to button bckground.
    Last edited by orenz; 10-26-03 at 12:13.
    Oren Zzz

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    This code functions as the Sleep (Good night)


    Private Declare Sub sapiSleep Lib "kernel32" _
    Alias "Sleep" _
    (ByVal dwMilliseconds As Long)

    Sub sSleep(lngMilliSec As Long)
    If lngMilliSec > 0 Then
    Call sapiSleep(lngMilliSec)
    End If
    End Sub

    Sub sTestSleep()
    Const cTIME = 1000 'in MilliSeconds
    Call sSleep(cTIME)
    MsgBox "Before this Msgbox, I was asleep for " _
    & cTIME & " Milliseconds."
    End Sub


  3. #3
    Join Date
    Oct 2003
    Location
    Is
    Posts
    21

    There is an eror in the declare of this function

    Private Declare Sub sapiSleep Lib "kernel32" _
    Alias "Sleep" _
    (ByVal dwMilliseconds As Long)
    Oren Zzz

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    And then, ....

  5. #5
    Join Date
    Oct 2003
    Location
    Is
    Posts
    21

    My mistake it works but i wrote this code and

    it works ok but i dont want the msgbox to open because i want a push button and when i delete the message box i cant see the color change

    Private Sub w_Click()
    w.BackColor = 13209
    Const cTIME = 1000 'in MilliSeconds
    Call sSleep(cTIME)

    ' the msgg box-
    MsgBox "Before this Msgbox, I was asleep for " _
    & cTIME & " Milliseconds."
    '

    w.BackColor = 16777215
    End Sub

    do you have other idea???
    Oren Zzz

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Wink Re: My mistake it works but i wrote this code and

    Originally posted by orenz
    it works ok but i dont want the msgbox to open because i want a push button and when i delete the message box i cant see the color change

    Private Sub w_Click()
    w.BackColor = 13209
    Const cTIME = 1000 'in MilliSeconds
    Call sSleep(cTIME)

    ' the msgg box-
    MsgBox "Before this Msgbox, I was asleep for " _
    & cTIME & " Milliseconds."
    '

    w.BackColor = 16777215
    End Sub

    do you have other idea???
    Perhaps you can drop this
    MsgBox "Before this Msgbox, I was asleep for " _
    & cTIME & " Milliseconds."
    and you will see the backColor of your Button changed after 1000 MilliSeconds



  7. #7
    Join Date
    Oct 2003
    Location
    Is
    Posts
    21

    I already tried it and it didnt work..

    maybe i'll try to use the repaint function and then try again...however thanks for your help....
    Oren Zzz

  8. #8
    Join Date
    Oct 2003
    Location
    Boston, Mass. USA
    Posts
    81
    well, you can make a standard access button invisible and then load a clip art or jpg and make it the same size and location I think you have to send it to the back behind the invisble button. Though visble = no, the OnEvent property should still work.

    It's been a long time since I did this, so you might have to play with it a bit. (Does the boss really insist on a colored button? ) but I know I was doing this long before I even really knew that VB could be used with Acces.

  9. #9
    Join Date
    Oct 2003
    Location
    Is
    Posts
    21

    Wink It's might work...But i dont want

    to copy a jpg for each button..Cause it might Slow My mdb Prog

    Im sure that there is a function to do a deelay in Vba..
    Oren Zzz

Posting Permissions

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