Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Requery() will not update combox with new data

Status
Not open for further replies.

Millard

Programmer
Feb 22, 2001
17
0
0
US
Requery() does not update my combo box after adding a
new record to the file. The combo box has properties to
to query (SQL) the table once activated, however, the
new record does not appear until you exit the form
and re-enter. Why THISFORM.mycombox.requery() does not
refresh with the new record?
 
Try to refresh the form or combo after the requery
 
Hello,

I believe you are confusing view's Requery() with combo's Requery(). They are different things.

Your code should look like this:

Requery("view") && it will download new data
Thisform.Combo.Requery() && fill the combo with the data


Hope this helps,


Grigore Dolghin
Class Software
Bucharest, Romania
 
Thanks, however, I used the THISFORM.REFRESH() after
THISFORM.mycombobox.Requery() and it will not refresh.

Grigore Dolghin it is Not a view, its a combo box
"Thisform.mycombobox.requery"

Millard




 
Millard,

How about something like this:

cRowSource = THISFORM.mycombobox.RowSource
THISFORM.mycombobox.RowSource = ''
THISFORM.mycombobox.Requery()
THISFORM.mycombobox.RowSource = cRowSource

Hope it works


-- AirCon --
 
If all else fails, add the "build combo" code as a custom method of the combo. Ive had this problem before, and as a result I always have a ZBuild method on combos. I generally perform a select-sql command to a cursor, and then build the combo from scratch, using the additem method. It may seem long winded but it always works.


WTrueman
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top