create hotkey

hi there...anybody to help me with this??i'm doing a pizza system where there is a form, with few listboxes. when the form load, the user need to press F1 to show all items of pizza in the first list box. then when the user press F2, all items of side order will b shown in the second list box. n as follow...the list boxes should be overlap. n im using ado.

second question. um..for the log in page before my system, there is an interface requesting for user name and password. how can i search for the username and password by using ado. my records are in microsoft access.and i would need to set the authority access for every user. for instance, only manager can access report menu. please show me how to perform all these...thankx u..

«1

Comments

  • [b][red]This message was edited by lionb at 2002-9-25 13:19:2[/red][/b][hr]
    : hi there...anybody to help me with this??i'm doing a pizza system where there is a form, with few listboxes. when the form load, the user need to press F1 to show all items of pizza in the first list box. then when the user press F2, all items of side order will b shown in the second list box. n as follow...the list boxes should be overlap. n im using ado.
    :
    : second question. um..for the log in page before my system, there is an interface requesting for user name and password. how can i search for the username and password by using ado. my records are in microsoft access.and i would need to set the authority access for every user. for instance, only manager can access report menu. please show me how to perform all these...thankx u..
    :
    :
    There is Form property named "KeyPreview" set it to "True". Then write code like that

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case 112 'F1 is pressed
    List1.Visible = True
    ' code to load List1
    Case 113 'F2 is pressed
    List2.Visible = True
    ' code to load List2
    End Select
    End Sub

    About second question. You can create special table in Access DB with Password and ,let's say, Position fields. The data in the Password field must be encrypted. Check the documentation for Access about this. In your code write SQL like that
    Select Position from LogonTable where Password = '" & txtPassword &"'
    If rs.Fields("Position") = "Manager" then
    'do what you need
    end if. It's just very general idea. Your scenario could be very different.
  • : [b][red]This message was edited by lionb at 2002-9-25 13:19:2[/red][/b][hr]
    : : hi there...anybody to help me with this??i'm doing a pizza system where there is a form, with few listboxes. when the form load, the user need to press F1 to show all items of pizza in the first list box. then when the user press F2, all items of side order will b shown in the second list box. n as follow...the list boxes should be overlap. n im using ado.
    : :
    : : second question. um..for the log in page before my system, there is an interface requesting for user name and password. how can i search for the username and password by using ado. my records are in microsoft access.and i would need to set the authority access for every user. for instance, only manager can access report menu. please show me how to perform all these...thankx u..
    : :
    : :
    : There is Form property named "KeyPreview" set it to "True". Then write code like that
    :
    : Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    : Select Case KeyCode
    : Case 112 'F1 is pressed
    : List1.Visible = True
    : ' code to load List1
    : Case 113 'F2 is pressed
    : List2.Visible = True
    : ' code to load List2
    : End Select
    : End Sub
    :
    : About second question. You can create special table in Access DB with Password and ,let's say, Position fields. The data in the Password field must be encrypted. Check the documentation for Access about this. In your code write SQL like that
    : Select Position from LogonTable where Password = '" & txtPassword &"'
    : If rs.Fields("Position") = "Manager" then
    : 'do what you need
    : end if. It's just very general idea. Your scenario could be very different.
    :

    hi...thankx a lot.the method is working but i dunno how to let it overlap.n let say F1 list out all item of pizza.F2 list out all item of salad. how to write all these conditions?
  • : : [b][red]This message was edited by lionb at 2002-9-25 13:19:2[/red][/b][hr]
    : : : hi there...anybody to help me with this??i'm doing a pizza system where there is a form, with few listboxes. when the form load, the user need to press F1 to show all items of pizza in the first list box. then when the user press F2, all items of side order will b shown in the second list box. n as follow...the list boxes should be overlap. n im using ado.
    : : :
    : : : second question. um..for the log in page before my system, there is an interface requesting for user name and password. how can i search for the username and password by using ado. my records are in microsoft access.and i would need to set the authority access for every user. for instance, only manager can access report menu. please show me how to perform all these...thankx u..
    : : :
    : : :
    : : There is Form property named "KeyPreview" set it to "True". Then write code like that
    : :
    : : Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    : : Select Case KeyCode
    : : Case 112 'F1 is pressed
    : : List1.Visible = True
    : : ' code to load List1
    : : Case 113 'F2 is pressed
    : : List2.Visible = True
    : : ' code to load List2
    : : End Select
    : : End Sub
    : :
    : : About second question. You can create special table in Access DB with Password and ,let's say, Position fields. The data in the Password field must be encrypted. Check the documentation for Access about this. In your code write SQL like that
    : : Select Position from LogonTable where Password = '" & txtPassword &"'
    : : If rs.Fields("Position") = "Manager" then
    : : 'do what you need
    : : end if. It's just very general idea. Your scenario could be very different.
    : :
    :
    : hi...thankx a lot.the method is working but i dunno how to let it overlap.n let say F1 list out all item of pizza.F2 list out all item of salad. how to write all these conditions?
    :
    Are you asking me how to add items to ListBox?
  • : : : [b][red]This message was edited by lionb at 2002-9-25 13:19:2[/red][/b][hr]
    : : : : hi there...anybody to help me with this??i'm doing a pizza system where there is a form, with few listboxes. when the form load, the user need to press F1 to show all items of pizza in the first list box. then when the user press F2, all items of side order will b shown in the second list box. n as follow...the list boxes should be overlap. n im using ado.
    : : : :
    : : : : second question. um..for the log in page before my system, there is an interface requesting for user name and password. how can i search for the username and password by using ado. my records are in microsoft access.and i would need to set the authority access for every user. for instance, only manager can access report menu. please show me how to perform all these...thankx u..
    : : : :
    : : : :
    : : : There is Form property named "KeyPreview" set it to "True". Then write code like that
    : : :
    : : : Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    : : : Select Case KeyCode
    : : : Case 112 'F1 is pressed
    : : : List1.Visible = True
    : : : ' code to load List1
    : : : Case 113 'F2 is pressed
    : : : List2.Visible = True
    : : : ' code to load List2
    : : : End Select
    : : : End Sub
    : : :
    : : : About second question. You can create special table in Access DB with Password and ,let's say, Position fields. The data in the Password field must be encrypted. Check the documentation for Access about this. In your code write SQL like that
    : : : Select Position from LogonTable where Password = '" & txtPassword &"'
    : : : If rs.Fields("Position") = "Manager" then
    : : : 'do what you need
    : : : end if. It's just very general idea. Your scenario could be very different.
    : : :
    : :
    : : hi...thankx a lot.the method is working but i dunno how to let it overlap.n let say F1 list out all item of pizza.F2 list out all item of salad. how to write all these conditions?
    : :
    : Are you asking me how to add items to ListBox?
    :
    em..nope.not to add items to the listbox.
    say..i got a table(called menu.mdb) with code,description,price,key(stating F1,F2...)then in my vb interface,there r few listboxes.when the user press F1,the listbox1 containing all pizza info will b displayed. press F2, the listbox2 containing all salad info will be displayed. im able to activate the listbox when the hotkey is pressed but i hav no idea how to write the condition to perform the selection of info. n those listboxes cannot overlap each other.wut i want is they are overlap, n when the user press F1,listbox1 will be activated n so on. please help me with this,thank u
  • [b][red]This message was edited by lionb at 2002-9-26 10:37:8[/red][/b][hr]
    [b][red]This message was edited by lionb at 2002-9-26 10:34:17[/red][/b][hr]
    : em..nope.not to add items to the listbox.
    : say..i got a table(called menu.mdb) with code,description,price,key(stating F1,F2...)then in my vb interface,there r few listboxes.when the user press F1,the listbox1 containing all pizza info will b displayed. press F2, the listbox2 containing all salad info will be displayed. im able to activate the listbox when the hotkey is pressed but i hav no idea how to write the condition to perform the selection of info. n those listboxes cannot overlap each other.wut i want is they are overlap, n when the user press F1,listbox1 will be activated n so on. please help me with this,thank u
    :
    OK. I can give just very general idea because I do not know details about your project.
    Here is some code example


    Option Explicit
    Dim arPizza() As String 'array for Pizza
    Dim arSalad() As String ' array for Salad

    Private Sub cmdMenu_Click()
    Dim iPizza As Integer, iSalad As Integer
    Dim intPizzaCount As Integer, intSaladCounr As Integer
    Dim TotalPizzaPrice As Double

    'This will select Items from List boxes

    intPizzaCount = List1.ListCount - 1
    ReDim arPizza(0 To intPizzaCount) As String
    For iPizza = 0 To intCountPizza
    arPizza(iPizza) = List1.List(iPizza) 'DarQ thanks for your code
    Next

    intSaladCount = List2.ListCount - 1
    ReDim arSalad(0 To intSaladCount) As String
    For iSalad = 0 To intSaladCount
    arSalad(iSalad) = List2.List(iSalad)
    Next

    'Here you have to write code to connect to database
    'let's say you use rsPizza & rsSalad as recordsets
    'This retrieves and calculate Total Price for Pizzas

    For iPizza = 0 To intPizzaCount
    'because I have no idea how is your database organized, I gave you again very general example of SQL statement. This statement will retrive prise for every particular pizza.
    strSQl = "select PizzaPrice from Pizza where Pizza = '" & arPizza(iPizza) & "'"
    rsPiza.Open strSQl, cn 'cursor
    'next statement will calculate Total Prise for all selected Pizzas
    TotalPizzaPrice = TotalPizzaPrice + CDbl(rsPizza.Fields("PizzaPrice"))
    Next

    'Write here the similar code for Salads and all other Items from your restorant

    End Sub
    Again this is just very general idea but I hope it'll help a litle bit.
    Keep in touch. Do not hesitate to ask questions



  • : [b][red]This message was edited by lionb at 2002-9-26 10:37:8[/red][/b][hr]
    : [b][red]This message was edited by lionb at 2002-9-26 10:34:17[/red][/b][hr]
    : : em..nope.not to add items to the listbox.
    : : say..i got a table(called menu.mdb) with code,description,price,key(stating F1,F2...)then in my vb interface,there r few listboxes.when the user press F1,the listbox1 containing all pizza info will b displayed. press F2, the listbox2 containing all salad info will be displayed. im able to activate the listbox when the hotkey is pressed but i hav no idea how to write the condition to perform the selection of info. n those listboxes cannot overlap each other.wut i want is they are overlap, n when the user press F1,listbox1 will be activated n so on. please help me with this,thank u
    : :
    : OK. I can give just very general idea because I do not know details about your project.
    : Here is some code example
    :
    :
    : Option Explicit
    : Dim arPizza() As String 'array for Pizza
    : Dim arSalad() As String ' array for Salad
    :
    : Private Sub cmdMenu_Click()
    : Dim iPizza As Integer, iSalad As Integer
    : Dim intPizzaCount As Integer, intSaladCounr As Integer
    : Dim TotalPizzaPrice As Double
    :
    : 'This will select Items from List boxes
    :
    : intPizzaCount = List1.ListCount - 1
    : ReDim arPizza(0 To intPizzaCount) As String
    : For iPizza = 0 To intCountPizza
    : arPizza(iPizza) = List1.List(iPizza) 'DarQ thanks for your code
    : Next
    :
    : intSaladCount = List2.ListCount - 1
    : ReDim arSalad(0 To intSaladCount) As String
    : For iSalad = 0 To intSaladCount
    : arSalad(iSalad) = List2.List(iSalad)
    : Next
    :
    : 'Here you have to write code to connect to database
    : 'let's say you use rsPizza & rsSalad as recordsets
    : 'This retrieves and calculate Total Price for Pizzas
    :
    : For iPizza = 0 To intPizzaCount
    : 'because I have no idea how is your database organized, I gave you again very general example of SQL statement. This statement will retrive prise for every particular pizza.
    : strSQl = "select PizzaPrice from Pizza where Pizza = '" & arPizza(iPizza) & "'"
    : rsPiza.Open strSQl, cn 'cursor
    : 'next statement will calculate Total Prise for all selected Pizzas
    : TotalPizzaPrice = TotalPizzaPrice + CDbl(rsPizza.Fields("PizzaPrice"))
    : Next
    :
    : 'Write here the similar code for Salads and all other Items from your restorant
    :
    : End Sub
    : Again this is just very general idea but I hope it'll help a litle bit.
    : Keep in touch. Do not hesitate to ask questions
    :
    :
    :
    :
    lion,frankly im quite new to vb n i dun really understand the code u gav me n i think it doesn't met my requirement..sorry.can u giv me some time in which i'l explain the detail of that interface i encountered problems??
    first of all,there is a menu.mdb wif prodCode,prodDesc,prodPrice,key(stating F1,F2...).
    on de left hand side of my interface,there r few listboxes overlapping.when i press F1,all the detail of PIZZA will b displayed.F2,all details of SALAD will be displayed...im able to activate the hotkey but all my listboxes displaying same information of prodDesc.i hav no idea how to select all PIZZA items into the lstSelection,all SALAD items into lstSelection1...n the listboxes is not overlapping..
    then the user shall click on the item from the listbox,for example,on the listSelection of pizza, there r several item of pizza.the staff shall click on let say hawaiian pizza n the selected item shall b display on the textboxes on the the right hand side.there r lots of textboxes on the right hand side n when the staff select items,the selected code,description,price will be displayed automatically on the textboxes.em...do u understand wut im saying???sorry for any inconvinient i'd caused.i cant attach my file to u since this side doesnt offer this function.

  • [b][red]This message was edited by lionb at 2002-9-27 5:3:46[/red][/b][hr]
    : : [b][red]This message was edited by lionb at 2002-9-26 10:37:8[/red][/b][hr]
    : : [b][red]This message was edited by lionb at 2002-9-26 10:34:17[/red][/b][hr]
    : : : em..nope.not to add items to the listbox.
    : : : say..i got a table(called menu.mdb) with code,description,price,key(stating F1,F2...)then in my vb interface,there r few listboxes.when the user press F1,the listbox1 containing all pizza info will b displayed. press F2, the listbox2 containing all salad info will be displayed. im able to activate the listbox when the hotkey is pressed but i hav no idea how to write the condition to perform the selection of info. n those listboxes cannot overlap each other.wut i want is they are overlap, n when the user press F1,listbox1 will be activated n so on. please help me with this,thank u
    : : :
    : : OK. I can give just very general idea because I do not know details about your project.
    : : Here is some code example
    : :
    : :
    : : Option Explicit
    : : Dim arPizza() As String 'array for Pizza
    : : Dim arSalad() As String ' array for Salad
    : :
    : : Private Sub cmdMenu_Click()
    : : Dim iPizza As Integer, iSalad As Integer
    : : Dim intPizzaCount As Integer, intSaladCounr As Integer
    : : Dim TotalPizzaPrice As Double
    : :
    : : 'This will select Items from List boxes
    : :
    : : intPizzaCount = List1.ListCount - 1
    : : ReDim arPizza(0 To intPizzaCount) As String
    : : For iPizza = 0 To intCountPizza
    : : arPizza(iPizza) = List1.List(iPizza) 'DarQ thanks for your code
    : : Next
    : :
    : : intSaladCount = List2.ListCount - 1
    : : ReDim arSalad(0 To intSaladCount) As String
    : : For iSalad = 0 To intSaladCount
    : : arSalad(iSalad) = List2.List(iSalad)
    : : Next
    : :
    : : 'Here you have to write code to connect to database
    : : 'let's say you use rsPizza & rsSalad as recordsets
    : : 'This retrieves and calculate Total Price for Pizzas
    : :
    : : For iPizza = 0 To intPizzaCount
    : : 'because I have no idea how is your database organized, I gave you again very general example of SQL statement. This statement will retrive prise for every particular pizza.
    : : strSQl = "select PizzaPrice from Pizza where Pizza = '" & arPizza(iPizza) & "'"
    : : rsPiza.Open strSQl, cn 'cursor
    : : 'next statement will calculate Total Prise for all selected Pizzas
    : : TotalPizzaPrice = TotalPizzaPrice + CDbl(rsPizza.Fields("PizzaPrice"))
    : : Next
    : :
    : : 'Write here the similar code for Salads and all other Items from your restorant
    : :
    : : End Sub
    : : Again this is just very general idea but I hope it'll help a litle bit.
    : : Keep in touch. Do not hesitate to ask questions
    : :
    : :
    : :
    : :
    : lion,frankly im quite new to vb n i dun really understand the code u gav me n i think it doesn't met my requirement..sorry.can u giv me some time in which i'l explain the detail of that interface i encountered problems??
    : first of all,there is a menu.mdb wif prodCode,prodDesc,prodPrice,key(stating F1,F2...).
    : on de left hand side of my interface,there r few listboxes overlapping.when i press F1,all the detail of PIZZA will b displayed.F2,all details of SALAD will be displayed...im able to activate the hotkey but all my listboxes displaying same information of prodDesc.i hav no idea how to select all PIZZA items into the lstSelection,all SALAD items into lstSelection1...n the listboxes is not overlapping..
    : then the user shall click on the item from the listbox,for example,on the listSelection of pizza, there r several item of pizza.the staff shall click on let say hawaiian pizza n the selected item shall b display on the textboxes on the the right hand side.there r lots of textboxes on the right hand side n when the staff select items,the selected code,description,price will be displayed automatically on the textboxes.em...do u understand wut im saying???sorry for any inconvinient i'd caused.i cant attach my file to u since this side doesnt offer this function.
    :
    :
    Take a look at your message box on this board. I've sent my email there. Email me your file.


  • : [b][red]This message was edited by lionb at 2002-9-27 5:3:46[/red][/b][hr]
    : : : [b][red]This message was edited by lionb at 2002-9-26 10:37:8[/red][/b][hr]
    : : : [b][red]This message was edited by lionb at 2002-9-26 10:34:17[/red][/b][hr]
    : : : : em..nope.not to add items to the listbox.
    : : : : say..i got a table(called menu.mdb) with code,description,price,key(stating F1,F2...)then in my vb interface,there r few listboxes.when the user press F1,the listbox1 containing all pizza info will b displayed. press F2, the listbox2 containing all salad info will be displayed. im able to activate the listbox when the hotkey is pressed but i hav no idea how to write the condition to perform the selection of info. n those listboxes cannot overlap each other.wut i want is they are overlap, n when the user press F1,listbox1 will be activated n so on. please help me with this,thank u
    : : : :
    : : : OK. I can give just very general idea because I do not know details about your project.
    : : : Here is some code example
    : : :
    : : :
    : : : Option Explicit
    : : : Dim arPizza() As String 'array for Pizza
    : : : Dim arSalad() As String ' array for Salad
    : : :
    : : : Private Sub cmdMenu_Click()
    : : : Dim iPizza As Integer, iSalad As Integer
    : : : Dim intPizzaCount As Integer, intSaladCounr As Integer
    : : : Dim TotalPizzaPrice As Double
    : : :
    : : : 'This will select Items from List boxes
    : : :
    : : : intPizzaCount = List1.ListCount - 1
    : : : ReDim arPizza(0 To intPizzaCount) As String
    : : : For iPizza = 0 To intCountPizza
    : : : arPizza(iPizza) = List1.List(iPizza) 'DarQ thanks for your code
    : : : Next
    : : :
    : : : intSaladCount = List2.ListCount - 1
    : : : ReDim arSalad(0 To intSaladCount) As String
    : : : For iSalad = 0 To intSaladCount
    : : : arSalad(iSalad) = List2.List(iSalad)
    : : : Next
    : : :
    : : : 'Here you have to write code to connect to database
    : : : 'let's say you use rsPizza & rsSalad as recordsets
    : : : 'This retrieves and calculate Total Price for Pizzas
    : : :
    : : : For iPizza = 0 To intPizzaCount
    : : : 'because I have no idea how is your database organized, I gave you again very general example of SQL statement. This statement will retrive prise for every particular pizza.
    : : : strSQl = "select PizzaPrice from Pizza where Pizza = '" & arPizza(iPizza) & "'"
    : : : rsPiza.Open strSQl, cn 'cursor
    : : : 'next statement will calculate Total Prise for all selected Pizzas
    : : : TotalPizzaPrice = TotalPizzaPrice + CDbl(rsPizza.Fields("PizzaPrice"))
    : : : Next
    : : :
    : : : 'Write here the similar code for Salads and all other Items from your restorant
    : : :
    : : : End Sub
    : : : Again this is just very general idea but I hope it'll help a litle bit.
    : : : Keep in touch. Do not hesitate to ask questions
    : : :
    : : :
    : : :
    : : :
    : : lion,frankly im quite new to vb n i dun really understand the code u gav me n i think it doesn't met my requirement..sorry.can u giv me some time in which i'l explain the detail of that interface i encountered problems??
    : : first of all,there is a menu.mdb wif prodCode,prodDesc,prodPrice,key(stating F1,F2...).
    : : on de left hand side of my interface,there r few listboxes overlapping.when i press F1,all the detail of PIZZA will b displayed.F2,all details of SALAD will be displayed...im able to activate the hotkey but all my listboxes displaying same information of prodDesc.i hav no idea how to select all PIZZA items into the lstSelection,all SALAD items into lstSelection1...n the listboxes is not overlapping..
    : : then the user shall click on the item from the listbox,for example,on the listSelection of pizza, there r several item of pizza.the staff shall click on let say hawaiian pizza n the selected item shall b display on the textboxes on the the right hand side.there r lots of textboxes on the right hand side n when the staff select items,the selected code,description,price will be displayed automatically on the textboxes.em...do u understand wut im saying???sorry for any inconvinient i'd caused.i cant attach my file to u since this side doesnt offer this function.
    : :
    : :
    : Take a look at your message box on this board. I've sent my email there. Email me your file.
    :
    :
    :
    I've got yours emails. I am not able to work on this right way because I am at work now. I'll take a look at your code as soon as I can.


  • : : [b][red]This message was edited by lionb at 2002-9-27 5:3:46[/red][/b][hr]
    : : : : [b][red]This message was edited by lionb at 2002-9-26 10:37:8[/red][/b][hr]
    : : : : [b][red]This message was edited by lionb at 2002-9-26 10:34:17[/red][/b][hr]
    : : : : : em..nope.not to add items to the listbox.
    : : : : : say..i got a table(called menu.mdb) with code,description,price,key(stating F1,F2...)then in my vb interface,there r few listboxes.when the user press F1,the listbox1 containing all pizza info will b displayed. press F2, the listbox2 containing all salad info will be displayed. im able to activate the listbox when the hotkey is pressed but i hav no idea how to write the condition to perform the selection of info. n those listboxes cannot overlap each other.wut i want is they are overlap, n when the user press F1,listbox1 will be activated n so on. please help me with this,thank u
    : : : : :
    : : : : OK. I can give just very general idea because I do not know details about your project.
    : : : : Here is some code example
    : : : :
    : : : :
    : : : : Option Explicit
    : : : : Dim arPizza() As String 'array for Pizza
    : : : : Dim arSalad() As String ' array for Salad
    : : : :
    : : : : Private Sub cmdMenu_Click()
    : : : : Dim iPizza As Integer, iSalad As Integer
    : : : : Dim intPizzaCount As Integer, intSaladCounr As Integer
    : : : : Dim TotalPizzaPrice As Double
    : : : :
    : : : : 'This will select Items from List boxes
    : : : :
    : : : : intPizzaCount = List1.ListCount - 1
    : : : : ReDim arPizza(0 To intPizzaCount) As String
    : : : : For iPizza = 0 To intCountPizza
    : : : : arPizza(iPizza) = List1.List(iPizza) 'DarQ thanks for your code
    : : : : Next
    : : : :
    : : : : intSaladCount = List2.ListCount - 1
    : : : : ReDim arSalad(0 To intSaladCount) As String
    : : : : For iSalad = 0 To intSaladCount
    : : : : arSalad(iSalad) = List2.List(iSalad)
    : : : : Next
    : : : :
    : : : : 'Here you have to write code to connect to database
    : : : : 'let's say you use rsPizza & rsSalad as recordsets
    : : : : 'This retrieves and calculate Total Price for Pizzas
    : : : :
    : : : : For iPizza = 0 To intPizzaCount
    : : : : 'because I have no idea how is your database organized, I gave you again very general example of SQL statement. This statement will retrive prise for every particular pizza.
    : : : : strSQl = "select PizzaPrice from Pizza where Pizza = '" & arPizza(iPizza) & "'"
    : : : : rsPiza.Open strSQl, cn 'cursor
    : : : : 'next statement will calculate Total Prise for all selected Pizzas
    : : : : TotalPizzaPrice = TotalPizzaPrice + CDbl(rsPizza.Fields("PizzaPrice"))
    : : : : Next
    : : : :
    : : : : 'Write here the similar code for Salads and all other Items from your restorant
    : : : :
    : : : : End Sub
    : : : : Again this is just very general idea but I hope it'll help a litle bit.
    : : : : Keep in touch. Do not hesitate to ask questions
    : : : :
    : : : :
    : : : :
    : : : :
    : : : lion,frankly im quite new to vb n i dun really understand the code u gav me n i think it doesn't met my requirement..sorry.can u giv me some time in which i'l explain the detail of that interface i encountered problems??
    : : : first of all,there is a menu.mdb wif prodCode,prodDesc,prodPrice,key(stating F1,F2...).
    : : : on de left hand side of my interface,there r few listboxes overlapping.when i press F1,all the detail of PIZZA will b displayed.F2,all details of SALAD will be displayed...im able to activate the hotkey but all my listboxes displaying same information of prodDesc.i hav no idea how to select all PIZZA items into the lstSelection,all SALAD items into lstSelection1...n the listboxes is not overlapping..
    : : : then the user shall click on the item from the listbox,for example,on the listSelection of pizza, there r several item of pizza.the staff shall click on let say hawaiian pizza n the selected item shall b display on the textboxes on the the right hand side.there r lots of textboxes on the right hand side n when the staff select items,the selected code,description,price will be displayed automatically on the textboxes.em...do u understand wut im saying???sorry for any inconvinient i'd caused.i cant attach my file to u since this side doesnt offer this function.
    : : :
    : : :
    : : Take a look at your message box on this board. I've sent my email there. Email me your file.
    : :
    : :
    : :
    : I've got yours emails. I am not able to work on this right way because I am at work now. I'll take a look at your code as soon as I can.
    :
    :
    :
    I tried to download your projects and found out that vbp files are missing. Could you send them to me again?

  • hi there..im able to call listbox1 when F1 is pressed. able to call listbox2 when F2 is pressed n so on...unfortunately,when i press F1,items in the listbox1 is shown.but when i press F2,listbox2 is shown WITHOUT any items inside. anyone tell me y? these r my coding:
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)


    Select Case KeyCode
    Case 112 'F1 is pressed
    lstSelection.Visible = True
    lstSelection1.Visible = False
    lstSelection2.Visible = False
    lstSelection3.Visible = False
    lstSelection4.Visible = False
    Dim rs As New ADODB.Recordset, sql As String

    sql = "SELECT prodDesc,prodType" _
    & " FROM menu;"

    rs.Open sql, sConn1, adOpenKeyset, adLockOptimistic, adCmdText
    Do While Not rs.EOF And rs.Fields("prodType") = "F1"
    lstSelection.AddItem rs!prodDesc
    rs.MoveNext
    Loop

    rs.Close

    Case 113 'F2 is pressed
    lstSelection1.Visible = True
    lstSelection.Visible = False
    lstSelection2.Visible = False
    lstSelection3.Visible = False
    lstSelection4.Visible = False
    sql = "SELECT prodDesc,prodType" _
    & " FROM menu;"

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

    Do While Not rs.EOF And rs.Fields("prodType") = "F2"

    lstSelection1.AddItem rs!prodDesc
    rs.MoveNext
    Loop
    rs.Close
    End Sub


    PS:Then wut will happen is describe on the new message named"listbox,MSHFlexGrid"
  • "'hi there..im able to call listbox1 when F1 is pressed. able to call listbox2 when F2 is pressed n so on...unfortunately,when i press F1,items in the listbox1 is shown.but when i press F2,listbox2 is shown WITHOUT any items inside. anyone tell me y? these r my coding:"

    It was you last question, isn't it? Seems to me you use the same code to retrive data to lstSelection and lstSelection1 listboxes. Is that correct? If yes, what is differences between those two listboxes?
  • I think you need to slow down a bit and think ahead a little before you get all flustered. There are probably numerous design issues that you should consider. For instance, storing your data in the database with product types of "F1" or "F2" (etc) isn't a very good idea because you are making your stored information dependent on the program that accesses it. Values such as "PIZZA" or "SALAD" or the primary keys from a PRODUCTS table would be much better.

    Secondly, why are you using so many different listboxes? If you load the data into them each time the user presses F1 or F2, etc, why not use a single listbox?

    Thirdly, what happens when you need to add new products or extend the functionality of your program? If you plan ahead a little and create useful procedures to break up the functionality of your program into logical bits, then maintenance is made that much easier well ahead of time.

    [code]
    Public Enum ProductTypes
    Pizza = 0
    Salad = 1
    End Enum

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    Select Case KeyCode
    Case vbKeyF1 '112 'F1 is pressed

    Call LoadListbox(lstSelection, GetProductDescriptions(Pizza))

    Case vbKeyF2 '113 'F2 is pressed

    Call LoadListbox(lstSelection, GetProductDescriptions(Salad))

    End Select

    End Sub

    Private Sub LoadListbox(ByRef lstBox As ListBox, ByRef rstData As ADODB.Recordset)

    If rstData Is Nothing Then Exit Sub
    If rstData.RecordCount = 0 Then Exit Sub

    Do While Not rstData.EOF
    lstBox.AddItem rstData.Fields("prodDesc").Value
    rstData.MoveNext
    Loop

    End Sub

    Private Function GetProductDescriptions(ByVal ptProduct As ProductTypes) As ADODB.Recordset

    Dim rst As New ADODB.Recordset
    Dim strSQL As String
    Dim strProdType As String

    Select Case ptProduct
    Case Pizza
    strProdType = "PIZZA"
    Case Salad
    strProdType = "SALAD"
    End Select

    strSQL = "SELECT prodDesc FROM menu where prodType = '" & strProdType & "';"

    rst.Open strSQL, sConn1, adOpenKeyset, adLockOptimistic, adCmdText

    Set GetProductDescriptions = rst

    Set rst = Nothing

    End Function
    [/code]
  • [b][red]This message was edited by lionb at 2002-9-30 11:54:24[/red][/b][hr]
    : I think you need to slow down a bit and think ahead a little before you get all flustered. There are probably numerous design issues that you should consider. For instance, storing your data in the database with product types of "F1" or "F2" (etc) isn't a very good idea because you are making your stored information dependent on the program that accesses it. Values such as "PIZZA" or "SALAD" or the primary keys from a PRODUCTS table would be much better.
    :
    : Secondly, why are you using so many different listboxes? If you load the data into them each time the user presses F1 or F2, etc, why not use a single listbox?
    :

    I am not sure about this particular assigment but usually it's business rule in Pizza shop. When customewr call, the sales person has to see whole bunch information about Pizza. That information include type and size of Pizza and prices for every type/size, type of topping and price and so on. That will help saleperson to take order very quikly because sometimes some customers before he/she(in most cases she) order something ask about items and their prices.

    : Thirdly, what happens when you need to add new products or extend the functionality of your program? If you plan ahead a little and create useful procedures to break up the functionality of your program into logical bits, then maintenance is made that much easier well ahead of time.
    :
    : [code]
    : Public Enum ProductTypes
    : Pizza = 0
    : Salad = 1
    : End Enum
    :
    : Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    :
    : Select Case KeyCode
    : Case vbKeyF1 '112 'F1 is pressed
    :
    : Call LoadListbox(lstSelection, GetProductDescriptions(Pizza))
    :
    : Case vbKeyF2 '113 'F2 is pressed
    :
    : Call LoadListbox(lstSelection, GetProductDescriptions(Salad))
    :
    : End Select
    :
    : End Sub
    :
    : Private Sub LoadListbox(ByRef lstBox As ListBox, ByRef rstData As ADODB.Recordset)
    :
    : If rstData Is Nothing Then Exit Sub
    : If rstData.RecordCount = 0 Then Exit Sub
    :
    : Do While Not rstData.EOF
    : lstBox.AddItem rstData.Fields("prodDesc").Value
    : rstData.MoveNext
    : Loop
    :
    : End Sub
    :
    : Private Function GetProductDescriptions(ByVal ptProduct As ProductTypes) As ADODB.Recordset
    :
    : Dim rst As New ADODB.Recordset
    : Dim strSQL As String
    : Dim strProdType As String
    :
    : Select Case ptProduct
    : Case Pizza
    : strProdType = "PIZZA"
    : Case Salad
    : strProdType = "SALAD"
    : End Select
    :
    : strSQL = "SELECT prodDesc FROM menu where prodType = '" & strProdType & "';"
    :
    : rst.Open strSQL, sConn1, adOpenKeyset, adLockOptimistic, adCmdText
    :
    : Set GetProductDescriptions = rst
    :
    : Set rst = Nothing
    :
    : End Function
    : [/code]
    :



  • : I am not sure about this particular assigment but usually it's business rule in Pizza shop. When customewr call, the sales person has to see whole bunch information about Pizza. That information include type and size of Pizza and prices for every type/size, type of topping and price and so on. That will help saleperson to take order very quikly because sometimes some customers before he/she(in most cases she) order something ask about items and their prices.

    Well certainly. Business rules are what we all live by. At least those of us who are business programmers. I'm just saying that the data should be stored in the database independent of the user application. The application should conform to the data, not vice versa. I am, of course, assuming there is a good data model to begin with. And especially in the case of a call center/ operator interface program that will be used frequently and must be operable by people who will be doing multiple things at once and probably can't afford to take the time to learn all of the quircky behaviours of a particular application, there must be an extensive interface design *first* before you start banging out code (especially when you have no foundation in the language to start from).

    Consistency is the key. I've had the luck of working on a project where you could literally trace the evolution and development of the original coder's experience with VB. The very earliest blocks of code he wrote when he had no experience and had just taken the VB Fundamentals course from MS stood out like a sore thumb. And, ironically, when I was assigned to take over that project I was in the same boat. No experience with VB except for the standard one-week class. I'll freely admit that I fell into the same traps that he did. I had no experience. I had no design document(s). I had nobody to ask for suggestions. Going back to maintain and extend even my own code a year or two later was very enlightening and humbling.

    What I ultimately ended up doing was stopping altogether what I was doing and thinking about all the effort I was putting in to accomplish very little. I did the same kinds of things that arieal is doing. You find a band-aid to put over your current problem and then rush off to the next one and scramble around to find another band-aid. When I finally took the time to plan ahead and look for patterns and make an effort to modularize my program (and let me say that instituting a set of coding standards, even if it's for yourself, is well worth the effort) I actually deleted over 40% of my code. After that drasting clean-up the program was actually enjoyable to work on.

    I might also point out that using at least minimally proper grammar and spelling, not to mention complete sentences, go a long way in getting help (and respect) from others.
  • : : I am not sure about this particular assigment but usually it's business rule in Pizza shop. When customewr call, the sales person has to see whole bunch information about Pizza. That information include type and size of Pizza and prices for every type/size, type of topping and price and so on. That will help saleperson to take order very quikly because sometimes some customers before he/she(in most cases she) order something ask about items and their prices.
    :
    : Well certainly. Business rules are what we all live by. At least those of us who are business programmers. I'm just saying that the data should be stored in the database independent of the user application. The application should conform to the data, not vice versa. I am, of course, assuming there is a good data model to begin with. And especially in the case of a call center/ operator interface program that will be used frequently and must be operable by people who will be doing multiple things at once and probably can't afford to take the time to learn all of the quircky behaviours of a particular application, there must be an extensive interface design *first* before you start banging out code (especially when you have no foundation in the language to start from).
    :
    : Consistency is the key. I've had the luck of working on a project where you could literally trace the evolution and development of the original coder's experience with VB. The very earliest blocks of code he wrote when he had no experience and had just taken the VB Fundamentals course from MS stood out like a sore thumb. And, ironically, when I was assigned to take over that project I was in the same boat. No experience with VB except for the standard one-week class. I'll freely admit that I fell into the same traps that he did. I had no experience. I had no design document(s). I had nobody to ask for suggestions. Going back to maintain and extend even my own code a year or two later was very enlightening and humbling.
    :
    : What I ultimately ended up doing was stopping altogether what I was doing and thinking about all the effort I was putting in to accomplish very little. I did the same kinds of things that arieal is doing. You find a band-aid to put over your current problem and then rush off to the next one and scramble around to find another band-aid. When I finally took the time to plan ahead and look for patterns and make an effort to modularize my program (and let me say that instituting a set of coding standards, even if it's for yourself, is well worth the effort) I actually deleted over 40% of my code. After that drasting clean-up the program was actually enjoyable to work on.
    :
    : I might also point out that using at least minimally proper grammar and spelling, not to mention complete sentences, go a long way in getting help (and respect) from others.
    :
    Generally I agree with Infidel. I was in the same boat when I started to work as programmer using unforgetable COBOL, CICS and stuff like that but I did have a mentor and documentation. About this particular project. I am not sure what kind of project is it, I mean, is it real businnes project or school assigment or just try to make a little bit money working with local Pizza shop. Anyway it's good idea to have some flowchart or something like that before you start to code. In other words you must to know even generaly how and what you have to do.

    About language spelling and grammar. It seems to me English is not arieal's native language, correct me arieal if I am wrong. I live and work in the US but as you see my English is not that good either because it's not my native language. Therefore, I do understand arieals problem. If arieal does not live in the USA or other English speaking countries and do not speak in this language every day, I think it's forgivable at least spelling and grammar rules. But it's not forgivable for me.
Sign In or Register to comment.

Howdy, Stranger!

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

Categories