Update Problem, What am I doing wrong? 
Author Message
 Update Problem, What am I doing wrong?

Hello all, I am having trouble getting a DBcombo to update and maybe you
can point out where I went wrong.  I've done similar procedures in other
apps without this kind of problem.

I have an Access database with a table and I also have a query for each
state.  In my VB 4.0 (16-bit) app I have a combobox (Combo4) in which a
user can select a state and DBcombo listing available county codes based
on that state selection.  On the lost focus event for this control I
have the recordsource for Data2 reset to the correct query.  I
also have the DBcombo (DBcombo1) refreshed/refilled.

The problem:

On the first state selection this procedure works fine.  The DBcombo
gets the right
query and fills the list items accordingly.  However on any subsequent
state changes, the DBcombo does not update correctly!  The items in the
DBcombo stay the same.  Below is the code that is supposed to update the
DBcombo.  Anyone see what I'm doing wrong?

Thanks a million.
-----------------------------------------
Private Sub Combo4_LostFocus()

MousePointer = 11

    st$ = Combo4.Text
    Data2.RecordSource = st$
    DBCombo1.ListField = "County"
    DBCombo1.Refresh                 <-----I used these two lines both
separately
                                                              and
together, both with the same result.
    DBCombo1.ReFill

MousePointer = 0

End Sub
-----------------------------------------



Sun, 19 Nov 2000 03:00:00 GMT
 Update Problem, What am I doing wrong?

Hmm... I'm no pro, but have you tried Data2.Refresh as well?

/Daniel




Mon, 20 Nov 2000 03:00:00 GMT
 Update Problem, What am I doing wrong?

Have you tried putting this code in the Combo4_click event instead of the
LostFocus event.



Mon, 20 Nov 2000 03:00:00 GMT
 Update Problem, What am I doing wrong?

Than seemed to do it, thanx!

Quote:

> Hmm... I'm no pro, but have you tried Data2.Refresh as well?

> /Daniel





Fri, 24 Nov 2000 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Parameter Problem - What am I doing wrong?

2. Another date problem - What am I doing wrong?

3. Query performance issue - What Am I doing wrong?

4. What am I doing wrong

5. what i am doing wrong?

6. what am I doing wrong in this procedure?

7. What am I doing wrong with this SP??

8. What am I doing wrong???

9. What am I doing wrong?

10. Simple one what am i doing wrong

11. I think I am doing something wrong

12. Am I doing something wrong...??


 
Powered by phpBB® Forum Software