Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have 3 ComboBox, 1 TextBox controls in my "Generate Report" Form,

ComboBox1 = "Regions"
ComboBox2 = "Area"
Combobox3 = "Branch"
TextBox1  = "Date"

Any Values selected/displayed from the 3 ComboBoxes, becomes a function/procedure.. 

Dim registrant, spName as String

ComboBox1 = "Region IV"
ComboBox2 = "Cavite"
ComboBox3 = "Bacoor"
TextBox1  = "10/25/2011"

registrant = ComboBox1.SelectedItem & '' & ComboBox2.SelectedItem & '' & ComboBox3.SelectedItem

Registrant will then become this "REG_IVCaviteBacoor"


and my code will look like this,

spName = "CALL " & Registrant & "()"

spName = CALL REG_IVCaviteBacoor()

How can i call that Function??
Posted
Comments
Sergey Alexandrovich Kryukov 23-Oct-11 21:19pm    
What's the problem, you don't know how to call functions or what? Not clear. What does it mean "becomes a function/procedure", "this become this REG_IVCaviteBacoor, how "becomes"? where is the function to call?
--SA
Alan Tuscano 23-Oct-11 21:29pm    
I'm sorry sir,

I'm just a newbie in vb programming.. i am into VFP.. this is my first project using VB.. that is why i'm asking for help... i don't know how to call or refer to my problem..

After the User Selected Values from the 3 combo boxes, codes from the combo boxes is truncated and will look like "REG_IVCaviteBacoor" and is assigned to spName,

"spName then becomes CALL REG_IVCaviteBacoor()" and when executed will be like the one below..

CALL REG_IVCaviteBacoor()
.
.
.
.
.
.
.

Private Sub REG_IVCaviteBacoor()
.
.
.
.
End Sub

Here is how to call stored procedure.
http://www.a1vbcode.com/snippet-3030.asp[^]

Google[^] for more.
 
Share this answer
 
You need to use ADO.NET or something similar to talk to your database. The examples in the link show how to connect to a range of different databases and execute

MSDN ADO.NET Code examples[^]

This example will show you how to use parameters

SQL Parameters[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900