Results 1 to 2 of 2

Thread: global variables

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    global variables

    Hi
    I have 2 ComboBoxes in a form "frmPrompt"ne cbocategory and the other cbosubcategory
    When the form loads,cbocategory displays all the categories present in an SQL table "Category"
    and in the cbocategory_click,cbosubcategory displays only the subcategories corresponding to the highlighted category
    sc=cbocategory.itemdata(cbocategory.listindex)
    Rs1.open"Select*from SubCategory where CategoryID="&sc

    but the problem is that I have another form(frmindex) which is linked to the frmPrompt
    In frmindex I have a text field in which I assign a subcategory
    ssubcategory=txtsub
    when I hide frmindex and I show frmPrompt,I want to display the subcategory
    entered in frmindex(for example if ssubcategory=Education so in the cbosubcategory I want to highlight Education when frmPrompt loads)
    how can i do it?
    thanks

  2. #2
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: global variables

    Quote Originally Posted by engnouna
    Hi
    I have 2 ComboBoxes in a form "frmPrompt"ne cbocategory and the other cbosubcategory
    When the form loads,cbocategory displays all the categories present in an SQL table "Category"
    and in the cbocategory_click,cbosubcategory displays only the subcategories corresponding to the highlighted category
    sc=cbocategory.itemdata(cbocategory.listindex)
    Rs1.open"Select*from SubCategory where CategoryID="&sc

    but the problem is that I have another form(frmindex) which is linked to the frmPrompt
    In frmindex I have a text field in which I assign a subcategory
    ssubcategory=txtsub
    when I hide frmindex and I show frmPrompt,I want to display the subcategory
    entered in frmindex(for example if ssubcategory=Education so in the cbosubcategory I want to highlight Education when frmPrompt loads)
    how can i do it?
    thanks
    i am not sure if this would work but something like this
    VB Code:
    1. frmindex.txtsub = frmPrompt.cbocategory.listindex

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