|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Fill datasheet/Continuous form with vba code only
Hi, all
With vba code, I have a record’s array (with variable length) that I would display, and I don’t find the vba code that allows me to do that. Like a display on datasheet, continuous form or anything else(but without binding form to a table/query, just with vba code). I ‘m looking in internet, books, and I don’t find anything yet….means impossible? Anyone could help??? Thanks in advance |
|
#2
|
|||
|
|||
|
First, I gotta say it, I'd populate a table with the data and then go from there.
But if an array works for you so be it.<grin> This is doable in a form and probably a report but I've done it mostly with forms. Assuming you want to display everything on one page here's how you would do it. 1. Create a form that has a grid of textboxes. 2. Name the textboxes with row and column. (i.e. "txt"<row><col>, txt11, txt12, txt13, txt21,txt22,txt23, etc.) 3.Set the visible property of all the textboxes to false. 4. Now the code looks like this: Dim rowNdx as Integer Dim colNdx as Integer For rowNdx = 0 to Ubound(recArray,1) - 1 For colNdx = 0 to Ubound(recArray,2) -1 me.Controls("txt" & rowNdx & colNdx) = recArray(rowNdx,colNdx) me.Controls("txt" & rowNdx & colNdx).visible = TRUE Next Next That should do it. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Fill datasheet/Continuous form with vba code only |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|