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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the string in a Macro as output in an MS Access Form.... HELP!!

Status
Not open for further replies.

UWTechie

Programmer
May 24, 2001
18
0
0
CA
This is the code that I have which will get the sql from all the queries in a table, and then put it into a string

Sub sqlRetriever

Dim qDef As QueryDef
Dim sqlString As String
Dim qCnt As Integer
qCnt = CurrentDb.QueryDefs.Count



For i = 0 To (2)

Set qDef = CurrentDb.QueryDefs(i)
sqlString = sqlString + (qDef.Name + Chr(13))
sqlString = sqlString + (qDef.SQL + Chr(13) + Chr(13))

Next i

End Sub

I need to get the sqlString into a form, so that I can then export it to Excel, but linking to the form itself... But I HAVE NO IDEA how to get the string into the form... Not a bloody clue... I have tried everything...

ObjectName.Print sqlString, Me.txtSql = sqlString, etc...

Nothing has worked... Please help me, and try to be very explicit in what I should do, because i have never used VB before... thank you very much....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top