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!

Putting data into text boxes

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
IE
Hi all,
I am having alot of difficulty. I'm writing my first Access application using a form and a report.
The report is to contain 12 ID cards on it laid out like so on the report...
1 2
3 4
5 6
7 8
9 10
11 12
I have a list view which I am getting the data from. You can select as many to print as you wish. I am using a different array to hold each of the following...Name, Class, ID number. I also have a photo for each ID number, in the same dir as the app.
The first line of the code works fine. It pops the picture into the image. How do I populate the text box on the first ID card with the first element of the array and the second with the second? And so on?

objAccess.Reports(0).Controls!ImgPupil.Picture = "long_michelle-02-0080.jpg"
objAccess.Reports(0).Controls!txtClass = g_asClassName(j)
objAccess.Reports(0).Controls!txtName = g_asNames(j)

Any help very very gratefully received!!
Thanks,
Robin
 
objAccess.Reports(0).Controls!ImgPupil.Picture = g_asImagePath([IDNum])
objAccess.Reports(0).Controls!txtClass = g_asClassName([IDNum])
objAccess.Reports(0).Controls!txtName = g_asNames([IDNum])

Set the j to a value returned by the underling query. Then, as the record changes in the detail section of the report, the data displayed will be the data that corresponds to the ID being returned in that row.

If your just starting in reports, I don't think this will make a whole lot of sense. Also, I'm pretty sure the first line of code won't work, but the thought is to give you the idea of what would need top be done.
 
Hi,
Thanks for your help. I don't really have an underlying query. I just populated the arrays from the following using teh ListView...

For i = 1 To lvPupils.ListItems.Count
If (lvPupils.ListItems(i).Selected) Then
g_asPupilNum(j) = lvPupils.ListItems(i).Text
g_asNames(j) = lvPupils.ListItems(i).SubItems(1)
g_asClassName(j) = lvPupils.ListItems(i).SubItems(2)
j = j + 1
End If
Next i

Where do I retrieve an underlying value from?
Thanks,
Robin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top