Populate Text Boxes using VBA

Meijhana

New member
Local time
Today, 02:20
Joined
Aug 5, 2000
Messages
6
My Excel VBA skills are sufficient, but this is my first foray into Access VBA.

I want to make a table in a report.

Column 1 would be numbered (1-15)
Column 2 would be a person's name based off of my Query
Column 3 would be a blank column
Column 4 would be numbered 16-30
Column 5 would continue to be a person's name (if there are enough names)
Column 6 would be a blank column

I understand there is a way to do this doing VBA.

I assume I would put in a textbox every time I want a person's name from my query to appear.

How do I do the VBA code so that TxtBox1 shows record 1 for those criteria, TxtBox2 shows record 2 for the query criteria, etc?

I would just make each new text box be on a new row.

Did I mention that this report is grouped by page based off of another query criteria? Hopefully that does not make this more difficult.

Any help would be appreciated. I am getting tired of beating my head into a wall on this one.

Thanks

Meijhana
 
If it's a report, then you set the columns in the Page Setup of the report (File -> Page Setup) to the number of columns you want, and then set the format to down and across. You don't want a bazillion textboxes like that, especially since all the data already exists.

If you're trying to do this in a form, you're thinking too much like Access is some sort of "advanced Excel", which it's absolutely not. If that's the case, you'll have to rearrange your thinking to not be in terms of spreadsheets but rather in terms of databases.
 
First of all, this link will show you how to number each row af a query. You should also find that the Printer Setup allows more than one column.
 
Thanks, but that is not exactly fixing my problem. Maybe I did not state this correctly

I know how to make the multiple columns appear. What I cannot do is get the same num,ber of rows to appear regardless of the amount of data I have.

If I have only 4 names, I still want 6 columns with 15 rows.
Using the columns feature only seems to give me 3 columns with 4 rows

If I have 24 names, I want 6 columns with 15 rows, but I get 6 columns with 15 rows in the first 3 columns and 9 rows in the second 3 columns.

I am trying to match a word template that I am not allowed to modify the format of. I have tried to do a mail merge into the word template, but that did not go so well.

Thanks
 
You may need to create a temp table and pad out the records so you get the report you want.
 

Users who are viewing this thread

Back
Top Bottom