Results 1 to 33 of 33

Thread: [RESOLVED] Question in IF STATEMENT

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Resolved [RESOLVED] Question in IF STATEMENT

    im adding a 3 o'clock habit in my program every 3 pm in the computer clock an automatic voice will speak here is my code

    my code in Hour Label
    Code:
    lblhr.Caption = Format$(Now, "hh:mm:ss AM/PM")
    this will be put in my Form_Load
    Code:
    If lblhr.caption=3:00:00 pm then
                 
                 Dim app_path As String
                      app_path = App.Path
                 
                 If Right$(app_path, 1) <> "\" Then
                          app_path = app_path & "\"
                               txtmusic.Text = app_path & "3oclockhabit.wav"
                      With mmcplayer
                          .Filename = txtmusic.text
                              .Command = "open"
                                 .Command = "play"
                       End With
                 End If
    
             End If
    my problem is in the highlighted color what will i put... thanx

  2. #2
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Question in IF STATEMENT

    Try this:
    Code:
    If lblhr.Caption = "3:00:00 pm" Then
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  3. #3
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Question in IF STATEMENT

    If you want a talking voice, then get a text to speech activex control object, that you can get from a control dealer on the internet. You must pay for this one, because it's quite a big deal control to have...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  4. #4

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    ok sir thanx ill try....

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Question in IF STATEMENT

    Since you are using "hh:mm:ss AM/PM" then "hh" will give you "03" for "3" and "pm" will be "PM". So to do an exact comparison, you might want to use this?

    Code:
    If lblhr.Caption = "03:00:00 PM" Then
    You can also use LCase/Ucase to take care of case sensitivity as well.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  6. #6

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    something wrong with my code its not auto playing.... heres what i did

    in my Form_Load
    Code:
    'playing sound
    Dim app_path As String
        app_path = App.Path
            If Right$(app_path, 1) <> "\" Then
                app_path = app_path & "\"
                txtmusic.Text = app_path & "Prayer.wav"
            End If
            
    With MMControl1
        .Notify = False
            .Wait = True
                .Shareable = False
                    .Command = "close"
    End With
    
    
    If lblhr.Caption = "03:00:00 pm" Then
         With MMControl1
                    
                    .FileName = txtmusic.Text
                        .Command = "open"
                          .Command = "play"
                                         
      End With
    End If
    the prayer.wav is in my folder where my exe is located.... whats wrong with this code it must autoplay every 3pm.... but when the clock is already 3 pm it will not auto play..
    thanks for the help
    Last edited by phatus; May 19th, 2013 at 10:08 PM. Reason: change code

  7. #7
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Question in IF STATEMENT

    Try and debug the line

    mmcplayer.FileName = txtmusic2.Text

    What is the value of txtmusic2.Text when you debug it?

    I see you are calling this in the Form Load Event. You have to use a Timer to repeatedly check for the time match.
    Last edited by Siddharth Rout; May 19th, 2013 at 09:51 PM. Reason: amended Text
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  8. #8
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Question in IF STATEMENT

    It will be very uneasy that the form loads at 3:00:00 exactly
    You need to develop another aproach
    ... or use another event...
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  9. #9
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Question in IF STATEMENT

    Try a Timer Bomb program, that executes on an event and timer. Timer exactly might be when the computer machine is off, and then what will happen then, so to speak???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  10. #10

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    @koolskid the value of txtmusic2 when i ran it is the location of the prayer.wav

    @jggtz actually the form load or open at 8:00 am every day, i tried to put it in click event but it will be a additional work to our assign officer to click the button to play the prayer every 3pm so what i want is just it will auto play every 3 pm, i think and not sure if my argument is correct

    kindly check my project i attached it..

    http://www.mediafire.com/?iqy84ttz2y0a4qx
    its in ZIP
    thank you..

    i have a timer here is my code in my timer

    Code:
    Private Sub Timer1_Timer()
    lblhr.Caption = Format$(Now, "hh:mm:ss AM/PM")
    End Sub
    and this is for my time to show in my lblhr caption
    Code:
    Timer1.interval=200
    Last edited by phatus; May 19th, 2013 at 10:36 PM.

  11. #11
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Question in IF STATEMENT

    It sounds okay, if it's not a virus or malicious source coded program that we're doing, right???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  12. #12
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Question in IF STATEMENT

    @Phatus: As I suggested in post 7, you have to use a timer to check for the time. Search VB Forums. There are plenty of examples which show how a timer works
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  13. #13

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    no its not a virus or a malicious source coded..... my intention is to add this feature in my Service Number System it was sugegsted to me that it is better to have a 3oclock habit prayer that auto play every 3pm in the afternoon....

  14. #14

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    @koolskid is my timer wrong in my post no. 10 or i need to add another timer? sorry in just a beginner and this is my first project

    here is my Service Number System


    and when 3 oclock i want to auto play the 3oclock prayer....

  15. #15
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Question in IF STATEMENT

    Lemme get access to a pc which has vb6 and then I will get back to you on this thread in case anyone else doesn't get back to you...

    BTW it is not koolskid
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  16. #16
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Question in IF STATEMENT

    Try this to check the Time, using the Timer1 events, which you have to try using in an .Enabled = True Timer Control, try naming like what I have given it, because that way if you have multipuls of Timer Controls then you can then keep track of all of them. And then name everything else, like cmdOK for a CommandButton, etc...
    Code:
    Timer1.Interval = Time
    This type of Source Code isn't working right, so then add in a TextBox and then check both the Timer and then convert the .Intervals to seconds, rememeber that 1000ms equals a total of one second, in general time speaking forms...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  17. #17

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    @ TheEiMp "so then add in a TextBox and then check both the Timer and then convert the .Intervals to seconds, rememeber that 1000ms equals a total of one second, in general time speaking forms..."

    can u give me sample of a code so that i can understand.. ty

  18. #18
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: Question in IF STATEMENT

    Code:
      
                txtmusic.Text = App.Path & "\Prayer.wav"
    
            
    With MMControl1
        .Notify = False
            .Wait = True
                .Shareable = False
                    .Command = "close"
    End With
    
    
    If lblhr.Caption = "03:00:00 PM" Then
         With MMControl1
                    
                    .FileName = txtmusic.Text
                        .Command = "open"
                          .Command = "play"
                                         
      End With
    End If

    or


    [CODE]If InStr(Label1.Caption, "03:00:00") Then

    txtmusic.Text = App.Path & "\3oclockhabit.wav"

    With mmcplayer
    .Filename = txtmusic.text
    .Command = "open"
    .Command = "play"
    End With
    End If

    End If

    this will play it as long your time format is same 03:00:00

    please attach ur source thanks..


    also if u cant attach source tell us the label name for the time


    also do this

    for accurate results

    instead of using timer lable use text1.text

    and try this code

    text1.text = 03:00:00

    Code:
    If InStr(Text1.Text, "3") Then
    MsgBox "alert play azan"
    End If

    so u gona be doing this



    Code:
    If InStr(Text1.Text, "03:00:00") Then
    txtmusic.Text = App.Path & "\3oclockhabit.wav"
                              
                      With mmcplayer
                          .Filename = txtmusic.text
                              .Command = "open"
                                 .Command = "play"
                       End With
                 End If
    
             End If
    bare in mind your using text1.text as timer not lable

    it works
    Last edited by ladoo; May 20th, 2013 at 12:39 AM.

  19. #19

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    Quote Originally Posted by ladoo View Post
    Code:
      
                txtmusic.Text = App.Path & "\Prayer.wav"
    
            
    With MMControl1
        .Notify = False
            .Wait = True
                .Shareable = False
                    .Command = "close"
    End With
    
    
    If lblhr.Caption = "03:00:00 pm" Then
         With MMControl1
                    
                    .FileName = txtmusic.Text
                        .Command = "open"
                          .Command = "play"
                                         
      End With
    End If

    or


    Code:
    If InStr(Label1.Caption, "03:00:00") Then
                 
                 txtmusic.Text = App.Path & "\3oclockhabit.wav"
                              
                      With mmcplayer
                          .Filename = txtmusic.text
                              .Command = "open"
                                 .Command = "play"
                       End With
                 End If
    
             End If
    this will play it as long your time format is same 03:00:00
    i tried the code you given but its not playing when the time is 3:00 pm.... maybe sir your can test it, i attached my project in my post no. 10
    Last edited by phatus; May 20th, 2013 at 12:49 AM.

  20. #20
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: Question in IF STATEMENT

    sorry u didnt try my code , i can be blinded and tell u didnt so admit it us all putting effort to help u coding it and u there not trying the code out



    reasons why it didnt work


    old code i downloaded from your source


    Code:
    Private Sub Form_Load()
    Timer1.Interval = 200
    
    Dim app_path As String
        app_path = App.Path
            If Right$(app_path, 1) <> "\" Then
                app_path = app_path & "\"
                    txtmusic.Text = app_path & "prayer.wav"
            End If
            
    With MMControl1
        .Notify = False
            .Wait = True
                .Shareable = False
                    .Command = "close"
    End With
    
    If lblhr.Caption = "03:00:00 pm" Then
         With MMControl1
                     .FileName = txtmusic.Text
                        .Command = "open"
                          .Command = "play"
                                         
      End With
    End If
    End Sub
    
    Private Sub Timer1_Timer()
    lblhr.Caption = Format$(Now, "hh:mm:ss AM/PM")
    End Sub




    fixed code




    Code:
    Private Sub Form_Load()
    Timer1.Interval = 200
    Dim app_path As String
        app_path = App.Path
            If Right$(app_path, 1) <> "\" Then
                app_path = app_path & "\"
                    txtmusic.Text = app_path & "prayer.wav"
            End If
            
    With MMControl1
        .Notify = False
            .Wait = True
                .Shareable = False
                    .Command = "close"
    End With
    
    End Sub
    
    Private Sub Timer1_Timer()
    Text3.Text = Format$(Now, "hh:mm:ss AM/PM")
    If InStr(Text3.Text, Text1.Text) Then
         With MMControl1
                     .FileName = txtmusic.Text
                        .Command = "open"
                          .Command = "play"
                                         
      End With
    End If
    End Sub


    or


    Code:
    Private Sub Form_Load()
    Timer1.Interval = 200
    txtmusic.Text = App.Path & "\3oclockhabit.wav"
            
    With MMControl1
        .Notify = False
            .Wait = True
                .Shareable = False
                    .Command = "close"
    End With
    
    End Sub
    
    Private Sub Timer1_Timer()
    Text3.Text = Format$(Now, "hh:mm:ss AM/PM")
    If InStr(Text3.Text, Text1.Text) Then
         With MMControl1
                     .FileName = txtmusic.Text
                        .Command = "open"
                          .Command = "play"
                                         
      End With
    End If
    End Sub



    i removed your .wav file just re add it in folder so it dont take me time to upload

    download
    http://www.sendspace.com/file/u98aft



    please next time if poeple paste there code try it dont be lazy
    Last edited by ladoo; May 20th, 2013 at 01:23 AM.

  21. #21

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    @ladoo whats this for InStr sir? is it a variable or string? im trying it sir sorry for not getting it im just begginer here i studied vb6 every sat bud i didnt finish it, thats why i dont have much knowledge in coding.....

    thank you ill tyr to understand how it works....

  22. #22
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: Question in IF STATEMENT

    instr meaning deep inner search for the value we looking for

    instr searches forward >>>> demotext

    instrrev searches for value backwards demotext <<<<<

    our value we searching for in this demo is o it will find it aether way


    instr is good to do indepth search for a value in a string


    say

    text1.text = "text1"
    text2.text = "text2"
    If text1.Text = text2.Text Then
    ' it means here is if text1 matches text 2 then its a match we found our value
    End If

    this will not not find the string u looking for it will not match

    but if we use

    if instr(text1.text,"ext1") then
    'match found , our value found
    end if

    sorry poor english
    Last edited by ladoo; May 20th, 2013 at 01:33 AM.

  23. #23

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: Question in IF STATEMENT

    ok sir thank you for the help... im looking at it now....

  24. #24
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: [RESOLVED] Question in IF STATEMENT

    read post 22 i edited about instr hope u get it now

  25. #25
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: [RESOLVED] Question in IF STATEMENT

    Has anyone read Posts #5 and #8?

    If you're dealing with Dates / Times why not use the variable Types and Functions associated with them ? Also, the Timer in VB6 is not particularly accurate and by 3:00PM it might not trigger until 3:01 in which case the sound will not be heard because all the code posted so far is looking for an exact match.
    Set the Timer Interval to 1 Second (1000)
    Code:
    Private Sub Timer1_Timer()
    '
    ' Add one second to the current time
    ' if the result is greater than 3PM then play the sound
    '
    If DateAdd("s", 1, Now) > CDate(Format(Now, "dd/mm/yyyy") & " 15:00:00") Then
         With MMControl1
            .FileName = txtmusic.Text
            .Command = "open"
            .Command = "play"
        End With
    End If
    End Sub

  26. #26
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: [RESOLVED] Question in IF STATEMENT

    Quote Originally Posted by Doogle View Post
    Code:
    If DateAdd("s", 1, Now) > CDate(Format(Now, "dd/mm/yyyy") & " 15:00:00") Then
    I think it can be simplified like:

    Code:
    If Time >= #3:00:00 PM# Then
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  27. #27
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: [RESOLVED] Question in IF STATEMENT

    @Bonnie - even better

  28. #28

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: [RESOLVED] Question in IF STATEMENT

    @ladoo yes i understand it now thanx for that information...

    @Doogle the solution given by sir ladoo is working by capturing the time at 03:00:00 PM it automatically play, and yes i read the post no. 5 and 8...

    i was thinking another option before sir ladoo's solution was to make a button to play the wav file and call it when it falls to 03:00:00 PM but it didnt work, by your suggestion and help, im increasing my knowledge in coding...

    thank you again fot the help and sorry for my english....

  29. #29
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Question in IF STATEMENT

    Code:
    Timer1.Interval = Timer1.Interval / 1000
    Text1.Text = Timer1. Interval
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  30. #30
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: [RESOLVED] Question in IF STATEMENT

    put this in button

    With MMControl1
    .FileName = txtmusic.Text
    .Command = "open"
    .Command = "play"

    End With

  31. #31
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: [RESOLVED] Question in IF STATEMENT

    I think that the OP was about an If statement, in which this Thread was titled as???
    So then where is the If statement that we should be coding???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  32. #32

    Thread Starter
    Member
    Join Date
    Apr 2013
    Posts
    40

    Re: [RESOLVED] Question in IF STATEMENT

    @ThEiMp the if statement had been change to another possible solution sir... and it is already resolve..

    thanx...

  33. #33
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: [RESOLVED] Question in IF STATEMENT

    -- So sorry for the mix up then...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

Posting Permissions

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



Click Here to Expand Forum to Full Width