How to refresh DBCombo box ?

Postby James Bott » Fri Feb 24, 2006 8:40 am

Milan,

OK, I think I have found what you are doing. You are using a numeic as the var cVno.

REDEFINE DBCOMBO oVno VAR cVno ID CBNAME OF oDlg

If you pass cVno as a numeric then it is returned as a numeric (but as you stated, not the correct value). Try passing it as a character and it will be returned as a character. Then you have to convert it back to numeric before saving it to your database.

I will take another look to see if I can modify dbcombo so we can use numerics too.
James
Last edited by James Bott on Fri Feb 24, 2006 8:59 am, edited 1 time in total.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Fri Feb 24, 2006 8:58 am

Milan,

I think I have the solution. See your email.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Milan Mehta » Fri Feb 24, 2006 10:29 am

James Bott wrote:Milan,

I think I have the solution. See your email.

James


Dear James,

Yet it works now. It looks like dawn after a long dark night !!!

Thanks a lot.

Milan.
Milan Mehta
 
Posts: 115
Joined: Mon Oct 17, 2005 4:42 am
Location: India

Postby James Bott » Fri Feb 24, 2006 12:43 pm

Yeah!
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby anserkk » Fri Nov 28, 2008 6:20 am

I have 2 DbCombo's in my App. I need to change the list in DbCombo2 when I change the selection in DbCombo1.

Unfortunately, I am not getting my DbCombo2 refreshed even after trying Refill(), Reset() and Default()

Any help ? Any idea where I have went wrong

My code

This code is called from the ON CHANGE of my DbCombo 1

Code: Select all  Expand view
// Taking data to array from a recordset
oRecSet:MoveFirst()
nBranchId:=oRecSet:Fields("Branch_Id"):Value
Do While !oRecSet:Eof()
   aAdd(aBranchId  ,str(oRecSet:Fields("Branch_Id"):Value,4))
   aAdd(aBranchName,oRecSet:Fields("Branch_Short_Name"):Value)
   oRecSet:MoveNext()
Enddo

// To check whether the array is generated with desired contents
MsgList(aBranchId)   // The array is OK
MsgList(aBranchName) // The array is Ok

// Resetting DbCombo with new array values
oDbCmb2:aItems:=aBranchId
oDbCmb2:aList:=aBranchName

// Resetting DbCombo Values on the fly
oDbCmb2:Refill()
oDbCmb2:reset()
oDbCmb2:default()
oDbCmb2:Refresh()



Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby anserkk » Fri Nov 28, 2008 7:14 am

Dear All,

Problem solved

Instead of

Code: Select all  Expand view
// Resetting DbCombo with new array values
oDbCmb2:aItems:=aBranchId
oDbCmb2:aList:=aBranchName

// Resetting DbCombo Values on the fly
oDbCmb2:Refill()
oDbCmb2:reset()
oDbCmb2:default()
oDbCmb2:Refresh()



I used, just 1 single line code, that solved the problem

Code: Select all  Expand view
oDbCmb2:SetItems(aBranchId, aBranchName)
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests