Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

vb-alert

ariealarieal Member Posts: 15
i'm doing a pizza system.let say on my form interface, i key in my user's phone->hit a autosearch button and it will automatically display the user's particular. wut i wanna do is when the system search through the database, it might found one column stating that it should aware of that user(of some reason)and the system will make the label (on the form interface)"bad customer" blinking or make sound. please help me with the autosearch button and how to perform the alert system. thank u


Comments

  • lionblionb Member Posts: 1,688 ✭✭
    : i'm doing a pizza system.let say on my form interface, i key in my user's phone->hit a autosearch button and it will automatically display the user's particular. wut i wanna do is when the system search through the database, it might found one column stating that it should aware of that user(of some reason)and the system will make the label (on the form interface)"bad customer" blinking or make sound. please help me with the autosearch button and how to perform the alert system. thank u
    :
    :
    :
    You are trying to trap clients with bad reputation. Is that correct? I used to work with Pizza Hut so generally I do understand what are you trying to do. But I have question for you. How are you going to retrive client phone number from the phone? Are you going to use some device/control like caller ID? Now my answer. First of all, you have create table with client's information inluding phone# and field like Good/Bad. That field could be Yes/No type meaning Yes - Good, No - bad.
    Then write code like that

    strSQL = "select Good/Bad from CustomerInfo where Phone = '"& cusPhone & "'"
    do until rs.EOF
    rs. Open strSQL, cn, cursor
    if rs.Fields("Good/Bad) = "Yes" then beep
    'write code using timer for blinking
    exit do
    loop

    Hope that will help a litle bit
  • ariealarieal Member Posts: 15
    : : i'm doing a pizza system.let say on my form interface, i key in my user's phone->hit a autosearch button and it will automatically display the user's particular. wut i wanna do is when the system search through the database, it might found one column stating that it should aware of that user(of some reason)and the system will make the label (on the form interface)"bad customer" blinking or make sound. please help me with the autosearch button and how to perform the alert system. thank u
    : :
    : :
    : :
    : You are trying to trap clients with bad reputation. Is that correct? I used to work with Pizza Hut so generally I do understand what are you trying to do. But I have question for you. How are you going to retrive client phone number from the phone? Are you going to use some device/control like caller ID? Now my answer. First of all, you have create table with client's information inluding phone# and field like Good/Bad. That field could be Yes/No type meaning Yes - Good, No - bad.
    : Then write code like that
    :
    : strSQL = "select Good/Bad from CustomerInfo where Phone = '"& cusPhone & "'"
    : do until rs.EOF
    : rs. Open strSQL, cn, cursor
    : if rs.Fields("Good/Bad) = "Yes" then beep
    : 'write code using timer for blinking
    : exit do
    : loop
    :
    : Hope that will help a litle bit
    :
    first of all, im really glad u r helping me a lot.
    im not going to use any device.wut i do is,when the customer called.i'll fill up the text field for phone.then i'll hit a button(autosearch),n all particular of that customer will be displayed.can u help me with the autosearch function?

  • lionblionb Member Posts: 1,688 ✭✭
    : : : i'm doing a pizza system.let say on my form interface, i key in my user's phone->hit a autosearch button and it will automatically display the user's particular. wut i wanna do is when the system search through the database, it might found one column stating that it should aware of that user(of some reason)and the system will make the label (on the form interface)"bad customer" blinking or make sound. please help me with the autosearch button and how to perform the alert system. thank u
    : : :
    : : :
    : : :
    : : You are trying to trap clients with bad reputation. Is that correct? I used to work with Pizza Hut so generally I do understand what are you trying to do. But I have question for you. How are you going to retrive client phone number from the phone? Are you going to use some device/control like caller ID? [blue] Now my answer. First of all, you have create table with client's information inluding phone# and field like Good/Bad. That field could be Yes/No type meaning Yes - Good, No - bad.
    : : Then write code like that
    : :
    : : strSQL = "select Good/Bad from CustomerInfo where Phone = '"& cusPhone & "'"
    : : do until rs.EOF
    : : rs. Open strSQL, cn, cursor
    : : if rs.Fields("Good/Bad) = "Yes" then beep
    : : 'write code using timer for blinking
    : : exit do
    : : loop
    : :
    : : Hope that will help a litle bit [/blue]
    : :
    : first of all, im really glad u r helping me a lot.
    : im not going to use any device.wut i do is,when the customer called.i'll fill up the text field for phone.then i'll hit a button(autosearch),n all particular of that customer will be displayed.can u help me with the autosearch function?
    :
    :
    I've already gave you an example. See blue marks above
  • ariealarieal Member Posts: 15
    : : : : i'm doing a pizza system.let say on my form interface, i key in my user's phone->hit a autosearch button and it will automatically display the user's particular. wut i wanna do is when the system search through the database, it might found one column stating that it should aware of that user(of some reason)and the system will make the label (on the form interface)"bad customer" blinking or make sound. please help me with the autosearch button and how to perform the alert system. thank u
    : : : :
    : : : :
    : : : :
    : : : You are trying to trap clients with bad reputation. Is that correct? I used to work with Pizza Hut so generally I do understand what are you trying to do. But I have question for you. How are you going to retrive client phone number from the phone? Are you going to use some device/control like caller ID? [blue] Now my answer. First of all, you have create table with client's information inluding phone# and field like Good/Bad. That field could be Yes/No type meaning Yes - Good, No - bad.
    : : : Then write code like that
    : : :
    : : : strSQL = "select Good/Bad from CustomerInfo where Phone = '"& cusPhone & "'"
    : : : do until rs.EOF
    : : : rs. Open strSQL, cn, cursor
    : : : if rs.Fields("Good/Bad) = "Yes" then beep
    : : : 'write code using timer for blinking
    : : : exit do
    : : : loop
    : : :
    : : : Hope that will help a litle bit [/blue]
    : : :
    : : first of all, im really glad u r helping me a lot.
    : : im not going to use any device.wut i do is,when the customer called.i'll fill up the text field for phone.then i'll hit a button(autosearch),n all particular of that customer will be displayed.can u help me with the autosearch function?
    : :
    : :
    : I've already gave you an example. See blue marks above
    :
    i've tried with the coding but i can't solve the problem of "run time error'3704'the operation requested by the application is not allowed if de project is closed" here is my coding:

    Private Sub cmdAutoSearch_Click()
    Dim rs As New ADODB.Recordset, sql As String
    sql = "SELECT alert" _
    & " FROM Customer where Phone = '" & phone & "'"
    Do Until rs.EOF

    rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText

    If rs.Fields("alert") = "Yes" Then Beep
    'im trying to change the backcolor first to see is it working

    lblBadCust.BackColor = vbBlue
    'write code using timer for blinking


    ' Exit Do
    Loop
    rs.Close
    End Sub

    please help me with this..
  • lionblionb Member Posts: 1,688 ✭✭
    : : : : : i'm doing a pizza system.let say on my form interface, i key in my user's phone->hit a autosearch button and it will automatically display the user's particular. wut i wanna do is when the system search through the database, it might found one column stating that it should aware of that user(of some reason)and the system will make the label (on the form interface)"bad customer" blinking or make sound. please help me with the autosearch button and how to perform the alert system. thank u
    : : : : :
    : : : : :
    : : : : :
    : : : : You are trying to trap clients with bad reputation. Is that correct? I used to work with Pizza Hut so generally I do understand what are you trying to do. But I have question for you. How are you going to retrive client phone number from the phone? Are you going to use some device/control like caller ID? [blue] Now my answer. First of all, you have create table with client's information inluding phone# and field like Good/Bad. That field could be Yes/No type meaning Yes - Good, No - bad.
    : : : : Then write code like that
    : : : :
    : : : : strSQL = "select Good/Bad from CustomerInfo where Phone = '"& cusPhone & "'"
    : : : : do until rs.EOF
    : : : : rs. Open strSQL, cn, cursor
    : : : : if rs.Fields("Good/Bad) = "Yes" then beep
    : : : : 'write code using timer for blinking
    : : : : exit do
    : : : : loop
    : : : :
    : : : : Hope that will help a litle bit [/blue]
    : : : :
    : : : first of all, im really glad u r helping me a lot.
    : : : im not going to use any device.wut i do is,when the customer called.i'll fill up the text field for phone.then i'll hit a button(autosearch),n all particular of that customer will be displayed.can u help me with the autosearch function?
    : : :
    : : :
    : : I've already gave you an example. See blue marks above
    : :
    : i've tried with the coding but i can't solve the problem of "run time error'3704'the operation requested by the application is not allowed if de project is closed" here is my coding:
    :
    : Private Sub cmdAutoSearch_Click()
    [blue] You missed a couple things. First of all you have to have Connection object. Let's do it[/blue]
    Dim sConn as New.ADODB.Connection
    Dim rs As New ADODB.Recordset, sql As String
    [blue]Second. Connection must be opened. To do that you have to know Connection string[/blue]
    Dim strConn as String
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:YourFoderYour.mdb;Persist Security Info=False"
    sConn.Open strConn
    :
    : sql = "SELECT alert" _
    : & " FROM Customer where Phone = '" & phone & "'"
    [blue]We can not check recordest EOF property before it's not opened. That's why you got Error. So,let's open it[/blue]
    rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText
    [blue] Now we can try the rest of the code [/blue]
    : Do Until rs.EOF
    :
    : If rs.Fields("alert") = "Yes" Then Beep
    : 'im trying to change the backcolor first to see is it working
    :
    : lblBadCust.BackColor = vbBlue
    : 'write code using timer for blinking
    :
    :
    : ' Exit Do
    : Loop
    : rs.Close
    : End Sub
    :
    : please help me with this..
    :

  • ariealarieal Member Posts: 15
    the connection is okay oredi but de form is running but when i click the cmd button.nothing happen.i think there is prob with the if statement. can u figure out wut happen>..?Private Sub cmdAutoSearch_Click()
    Dim sConn As New ADODB.Connection
    Dim rs As New ADODB.Recordset, sql As String
    Dim strConn As String


    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:WINDOWSDesktopscreencustomer.mdb;Persist Security Info=False"
    sConn.Open strConn
    sql = "SELECT phone,alert" _
    & " FROM customer where phone = '" & phone & "' "
    rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText

    Do Until rs.EOF
    'i tried this but caused run-time error
    'Do While Not rs.EOF And rs.Fields("alert") = "Yes"

    If rs.Fields("alert") = "Yes" Then Beep
    'lblBadCust.BackColor = vbRed
    'write code using timer for blinking

    ' Exit Do
    Loop
    rs.Close

    End Sub

  • lionblionb Member Posts: 1,688 ✭✭
    : the connection is okay oredi but de form is running but when i click the cmd button.nothing happen.i think there is prob with the if statement. can u figure out wut happen>..?Private Sub cmdAutoSearch_Click()
    : Dim sConn As New ADODB.Connection
    : Dim rs As New ADODB.Recordset, sql As String
    : Dim strConn As String
    :
    :
    : strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:WINDOWSDesktopscreencustomer.mdb;Persist Security Info=False"
    : sConn.Open strConn
    : sql = "SELECT phone,alert" _
    : & " FROM customer where phone = '" & phone & "' "
    : rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText
    :
    [blue] Actually we do need this loop because we have unic phone#. So comment out following line and Loop. Also check the value of the rs. Is really = "Yes". May be something wrong with data in your table. I mean double check value of Phone and alert fields in table itself. Maybe value of textbox, I assume you call it 'phone' is not correct. It must be = table field Phone value where alert = "Yes". [/blue]
    : Do Until rs.EOF
    : 'i tried this but caused run-time error
    : 'Do While Not rs.EOF And rs.Fields("alert") = "Yes"
    :
    : If rs.Fields("alert") = "Yes" Then Beep
    : 'lblBadCust.BackColor = vbRed
    : 'write code using timer for blinking
    :
    : ' Exit Do
    : Loop
    : rs.Close
    :
    : End Sub
    :
    :

  • lionblionb Member Posts: 1,688 ✭✭
    : : the connection is okay oredi but de form is running but when i click the cmd button.nothing happen.i think there is prob with the if statement. can u figure out wut happen>..?Private Sub cmdAutoSearch_Click()
    : : Dim sConn As New ADODB.Connection
    : : Dim rs As New ADODB.Recordset, sql As String
    : : Dim strConn As String
    : :
    : :
    : : strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:WINDOWSDesktopscreencustomer.mdb;Persist Security Info=False"
    : : sConn.Open strConn
    : : sql = "SELECT phone,alert" _
    & " FROM customer where phone = '" & phone & "' ".
    : : rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText
    : :
    : [blue] Actually we do need this loop because we have unic phone#. So comment out following line and Loop. Also check the value of the rs. Is really = "Yes". May be something wrong with data in your table. I mean double check value of Phone and alert fields in table itself. Maybe value of textbox, I assume you call it 'phone' is not correct. It must be = table field Phone value where alert = "Yes". [/blue]
    : : Do Until rs.EOF
    : : 'i tried this but caused run-time error
    : : 'Do While Not rs.EOF And rs.Fields("alert") = "Yes"
    : :
    : : If rs.Fields("alert") = "Yes" Then Beep
    : : 'lblBadCust.BackColor = vbRed
    : : 'write code using timer for blinking
    : :
    : : ' Exit Do
    : : Loop
    : : rs.Close
    : :
    : : End Sub
    : :
    : :
    :
    :
    Your problem is right here & " FROM customer where phone = '" & phone & "' ". Change '" & phone & "' " to '" & txtPhone & "' "
  • ariealarieal Member Posts: 15
    : : : the connection is okay oredi but de form is running but when i click the cmd button.nothing happen.i think there is prob with the if statement. can u figure out wut happen>..?Private Sub cmdAutoSearch_Click()
    : : : Dim sConn As New ADODB.Connection
    : : : Dim rs As New ADODB.Recordset, sql As String
    : : : Dim strConn As String
    : : :
    : : :
    : : : strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:WINDOWSDesktopscreencustomer.mdb;Persist Security Info=False"
    : : : sConn.Open strConn
    : : : sql = "SELECT phone,alert" _
    : & " FROM customer where phone = '" & phone & "' ".
    : : : rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText
    : : :
    : : [blue] Actually we do need this loop because we have unic phone#. So comment out following line and Loop. Also check the value of the rs. Is really = "Yes". May be something wrong with data in your table. I mean double check value of Phone and alert fields in table itself. Maybe value of textbox, I assume you call it 'phone' is not correct. It must be = table field Phone value where alert = "Yes". [/blue]
    : : : Do Until rs.EOF
    : : : 'i tried this but caused run-time error
    : : : 'Do While Not rs.EOF And rs.Fields("alert") = "Yes"
    : : :
    : : : If rs.Fields("alert") = "Yes" Then Beep
    : : : 'lblBadCust.BackColor = vbRed
    : : : 'write code using timer for blinking
    : : :
    : : : ' Exit Do
    : : : Loop
    : : : rs.Close
    : : :
    : : : End Sub
    : : :
    : : :
    : :
    : :
    : Your problem is right here & " FROM customer where phone = '" & phone & "' ". Change '" & phone & "' " to '" & txtPhone & "' "
    :
    ello..i tried to change to txtPhone already.but it's still not working,so i change the while loop into like this.
    Private Sub cmdAutoSearch_Click()
    'Dim A
    Dim sConn As New ADODB.Connection
    Dim rs As New ADODB.Recordset, sql As String
    Dim strConn As String
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:WINDOWSDesktopscreencustomer.mdb;Persist Security Info=False"
    sConn.Open strConn
    sql = "SELECT phone,alert" _
    & " FROM Customer where phone = '" & txtPhone & "' "
    rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText

    Do Until rs.EOF And rs.Fields("alert") = "Yes"
    lblBadCust.BackColor = vbBlue
    Beep
    Exit Do
    ' A = MsgBox("NO SUCH RECORD", vbExclamation, "ERROR")
    Loop
    rs.Close
    End Sub

    it's now working will beep n backcolor is blue.but can u teach me how to write the condition inside do untill loop? wut i want is,when there it cant found the record then an msgbox will be displayed.
    after all, how can i fill up those other textbook fields (like address)when the record is found from my customer.mdb?

  • Shawn CarterShawn Carter Member Posts: 0

    _________ [ http://forcoder.org ] free ebooks and video tutorials about / Go Visual Basic .NET Ruby PL/SQL Python Java Assembly PHP C# Objective-C Perl MATLAB Visual Basic C++ Delphi Swift R Scratch JavaScript C Fortran Dart D Apex LabVIEW Clojure Lisp Scheme Lua Ada Logo VBScript Awk ABAP Crystal Alice FoxPro Rust SAS Julia Transact-SQL ML Prolog Erlang F# Scala Bash Hack COBOL Kotlin / __________

Sign In or Register to comment.