PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 2024 → Dynamically  Populated Combo Box
Dynamically Populated Combo Box
Iniciado por Carlos Antunez, 12,sep. 2014 21:41 - No hay respuesta
Publicado el 12,septiembre 2014 - 21:41
Hi and thanks in advanced for the help.

I have the following:
1 query Name qryCustomers
Fields for qryCustomers are: Cust_Name, Cust_Address, Cust_Zip_Code.
1 query Name qryZip_Codes

2 edit controls are linked to the qryCustomers query (Cust_Name) and (Cust_Address) then a combo box is linked to the Cust_Zip_Code field of the same query qryCustomers.

When I run the site and open the page, I dynamically populate the combo box with zip codes obtained from a parameter qryZip_Codes query I run. The combo box gets filled perfectly and it displays all the queried Zips.

I enter a new Customer Name, Address and I can select a Zip from the populated combo box without any problems, but when I save the record which by the way is not coming from a table, it saves the Customer Name and the address, but it won't save the zip code under the linked ZIP_CODE field, the next time I visit the same record I just saved, the Customer Name and Address are there but the combo box doesn't hold the Zip Code value I picked when I created the Customer.

This is the code I have on the initialization of the Combo Box

HExecuteQuery(qryZip_Codes, hQueryDefault)

HReadFirst(qryZip_Codes)
ListAdd("")
WHILE NOT HOut(qryZip_Codes)
ListAdd(COMBO_Zip_Code, ZIP_CODE)
HReadNext(qryZip_Codes)
END


This is the code I have on the Save Button

IF YesNo(Yes,"Are you Sure that you want to Save this Customer Now?","Please Confirm") = Yes THEN
PageToFile(PAGE_New_Customer)
HModify(qryCustomers)

END


Thanks for the help

Best regards,

Carlos