Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting records for Access 97 report from VB 6 program

Status
Not open for further replies.

tyedyejenn

Programmer
Jun 14, 2000
35
US
I am writing a program in VB6 and want to run a report from Access 97 to select certain records.&nbsp;&nbsp;I have the following line of code to run the report<br><br>Accapp.DoCmd.OpenReport &quot;LogIn Report&quot;, acViewNormal<br><br>I just don't know how to add a sql type statement to select the user name of person logging in(this infor is stored in strName)<br><br>If anyone can help me with this I would greatly appreciate it.&nbsp;&nbsp;Thanks in advance for the help.<br>Jenn
 
Jenn,

Build your sql like this:
[tt]
MySqlString = _
&quot;Select
<column list>&quot; _
& &quot; From
<table>&quot; _
& &quot; Where
<name column> = ' & strName & '&quot;
[/tt]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top