DBList Control Problem, please help me I'm an idiot 
Author Message
 DBList Control Problem, please help me I'm an idiot

I have a really stupid problem.  I am writing a data entry app.  The first
step is to select a site/project from a DBList, connected to a data control,
connected to a table of sites/projects.  Simple enough.  However, I have a
bunch of text boxes that show site data and some command buttons that are
hidden until a site is selected.  When one is selected, they appear. If I
click the list box again to pull it down or type, they should disappear.

I have tried to make the DBList_Change event trigger the showing of the other
controls, however, to change it you have to click it.  The DBList_Click event
hides the other controls, because the click event pulls the list open.

Question 1:  Is there a property that will tell me what the status of the
DBList is (pulled down or not)?  Knowing this would make everything easier (a
lot easier).

Question 2:  I know there is a way from a series of posts several months ago,
but I do not have them anymore...What is the code to pop the list open without
clicking?

Question 3 is not really that important if I get the answers to Questions 1
and 2, but here it is for *fun*...it has certainly got me frustrated...
In order to follow the sequence of events and determine which events are
necessary in the DBList_Click and DBList_Change events, I dimensioned a public
variable (integer) in the general declaration at startup.  In Form_Load, this
variable, called RunningStatus, is assigned a value of 1.  In the Click and
Change events, I use Select Case RunningStatus to determine what gets done and
what doesn't, and to update the variable's value.

Example:

        Select Case RunningStatus
        Case 1
           show this, hide that
           RunningStatus=2
        Case 2
           show that, hide this
           RunningStatus=3
        Case 3
           RunningStatus=2
        Case Else
           RunningStatus=1
        End Select

The Click and Change events each have slightly different code similar to
above.

I inserted a text box on the form to show the value of RunningStatus as the
code executed, and added "Text1.text = RunningStatus" all over the code.  I
also but stops throughout the above code.  When run, nothing appears in the
text box until after I click/change.  When this occurs, and the above code
runs, it skips past Case 1, Case 2, and Case 3, and runs Case Else.  A 1
appears in the text box and the subroutine ends.  So my form has a DBList and
a text box with a 1.  But when I click the DBList again, the 1 disappears, and
the same thing happens in the Select Case code -- it goes to the Case Else.  
Apparently, clicking the DBList clears the value of the variable
RunningStatus.  I know and have checked (about a billion times now) that there
is no code in any event in any control that is intended to clear any variable,
except to update it with a new value (at least not intentionally).  Any idea
what is causing this variable to be nulled out every time I click the DBList
control?

Thank you very much for any help you can provide.



Mon, 15 Mar 1999 03:00:00 GMT  
 DBList Control Problem, please help me I'm an idiot

An update of my problem, originally posted on or about 9/29/96:


says...

Quote:

>Question 1:  Is there a property that will tell me what the status of the
>DBList is (pulled down or not)?  Knowing this would make everything easier (a
>lot easier).

Still wondering about this one.

Quote:

>Question 2:  I know there is a way from a series of posts several months ago,
>but I do not have them anymore...What is the code to pop the list open
without
>clicking?

I hunted through some archived info, and found the answer to be
SendKeys "%{Down}"

Question 3 is evidence that the subject of the post was quite correct.  I am
an idiot.

Quote:
>Apparently, clicking the DBList clears the value of the variable
>RunningStatus.

Apparently, I dimmed the variable on the wrong form.

My apologies for any time you may have wasted checking into this.  I know I
wasted a lot of time on it.  If anyone has an answer to #1, I would still love
to know it.

Thanks again to all.



Fri, 19 Mar 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. rowSource + dataSource with DBList problem (VB5)--please help

2. Please Help!!!!! - vb5 DBList control

3. Please Help!!!!!!- vb5 DBlist control

4. Please Help!!!!!!- vb5 DBlist control

5. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

6. Please help this Idiot one more time.....

7. ahhhhhhhh I need help (and i'm an idiot)

8. PROBLEM HELP - Data control on one form and dblist on the other

9. PROBLEM HELP - Data control on one form and dblist on the other

10. Help a VB idiot - combo box and database problems

11. Problem with Data control or DBList control?

12. I'm having trouble using a DBList control

 

 
Powered by phpBB® Forum Software