Question

Locked

How do I use a character string as a data source in a MS Access report?

By edean65 ·
What I'd like to do is this:

(1) Create a global variable in a report module so it is known across the entire instance of a MS Access database session (already have this working).

(2) Fill the above global character string with 114 character wide records. I'd prefer to send the string without it being an array of several 114 character strings-- my current string is open ended as to its length and I am parsing it into 114 character segments using VBA's MID$ function. I want to use each of these segments as my "record:" for each iteration of the detail section in my report. If an array of strings is easier that would be great, but I'd need an example.

(3) Here is my question: Can I set the report record source to the following:
MID$(RecsInString$, start_pos, 114), then on the retreat event from the detail section, increment the variable start_pos so that it points to the beginning of my next "section" in the string as the source for the next detail line?

Does this work, or something similar? Does anyone have another idea? I tried to use a form control such as a textbox with an open-ended text property but it was flagged as private to the form and unavailable to the report. I need to get this working quickly. At work I've been cautioned against using a temporary table (or any table) that has to be populated at run time for the above report due to multi-user requests causing conflicts to simultaneous users of this system.

Any help would be appreciated.

Earl P. Dean

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Given what access is, and the way it works

by Tony Hopkinson In reply to How do I use a character ...

can't see how this is doable.
Two things you might want to look at. Create a textfile for the data, and then use the ODBC Text driver to set up the source.
The multi-user problem (bearing in mind access is crap at multi user), all you need is a session ID.
So if you had a table with sessionID and data. Whatever fills it in generates or uses the key, and then does an append query, then you call the report with this session id with a parameter, might want to look at getting rid of the data on the report being successful.

Collapse -

Reponse To Answer

by edean65 In reply to Given what access is, and ...

Sorry I didn't get back to this quicker-- we went ahead and used some large queries against the main tables, and allowed temp tables for a later report. Thanks for the session idea. That might work.

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums