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!

Adding text boxes during runtime in VB app

Status
Not open for further replies.

kco1122

Programmer
Nov 16, 2000
3
US
Hi! I've got an app in VB6 that uses Crystal Reports 8. I have a number of reports already in the program, but the one I'm creating now is slightly different.

I need to create a series of text boxes that have different data in them that will appear in the report. Here's the code I'm using:

***********
For x = 1 To intDeptNames
Report.Sections(3).AddTextObject("test me",6000,300)
Next
***********

This was based off an example I got from a book. However the error I'm getting seems to be a VB syntax problem... everytime I move from the line that reads "Report..." I get a 'Compile Error: Expected =". But I don't see why this is happening. Can anyone let me know if there is something wrong here? For now I've pulled the array out and replaced the text with "test me", but even that won't work.

Thank you in advance for any help.
 
I think that VB expects a return value because of the parenthesis, i.e. calling a function, which does return a value.
Try this.

Report.Sections(3).AddTextObject "test, me",6000,300
 
Woops sorry! This might work a little better.

Report.Sections(3).AddTextObject "test me",6000,300

 
put call in front of it, thats a function, and you must call it or else it thinks your assigning it to something thus giving the error expects '='
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top