>I'm trying to create a report using VB6's data report. I have already created a dataenvironment, a connection, and a command. My command is set to a SQL query like:
>
>Select * from emp_mast where salary >= ?
>
>At the command's parameter tab the parameter panel contains: Param1.
>
>The problem is I do not know how to pass a value to this command programmatically. Can anyone show me some code on how to do this?
>
>Thanks in advance!
>
>Ramon carlos
Hi Ramon,
This is a piece of code to get data programmatically:
Dim strQuery as String
Dim strCriteria as String
strCriteria = "Whatever"
strQuery = "Select A.ID FROM Contacts A Where A.ID = '" & Trim(strCriteria)& "';"
Set db = CurrentDb()
Set rstContacts = db.OpenRecordset(strQuery, dbOpenSnapshot)
... your code goes here ...
HTH, Igor
Igor Gelin
Database Developer