PmiWCombo: Display Options from database

This is the main technical forum for discussing problems that were encountered by users while developing PROMOTIC applications, and their possible solutions.

PmiWCombo: Display Options from database

Postby WhitNey » Thu 16. Jul 2015 15:23:46

Hi again there.
I'm trying to edit my Combo box options according to some data I retrieve from database. Since my database is changing, I would like my Combo Box options to be changing accordingly; therefore I am not going to manually type in my data into the Combo attributes (Options). I don't like to use macro.expression either. Is it possible to edit the Options by coding only? The code below is written in onFocusIn. What should I write in the BOLD line?

By the way, my database file extension is MDB and I have already loaded it into PmTable.
Thanks a lot.

[code][/code]
Dim oAxTable,oCombo,n,arr(12)
Set oAxTable = pMe.Items("/axTable").Acx
Set oCombo = pMe.Items("/Combo")
n = oAxTable.Rows
Do
n = n-1
arr(n)= oAxTable.GetCellText(n,2)
Loop While n>0
oCombo.RemoveOptions
oCombo.AddOption "val1=arr(12)"
oCombo.AddOption "val2=Second"
oCombo.AddOption "val3=Third"
WhitNey
 
Posts: 4
Joined: Tue 07. Jul 2015 3:56:44

Re: PmiWCombo: Display Options from database

Postby WhitNey » Mon 20. Jul 2015 13:37:25

Hi, got it by myself :D
Still in the process of learning...Thanks btw
oCombo.AddOption"va1=" + arr(12)
WhitNey
 
Posts: 4
Joined: Tue 07. Jul 2015 3:56:44

Re: PmiWCombo: Display Options from database

Postby admin » Tue 21. Jul 2015 9:09:22

Well done :)
admin
Administrátor
 
Posts: 69
Joined: Wed 12. Dec 2012 15:43:09


Return to I don't know how to...

Who is online

Users browsing this forum: No registered users and 3 guests