INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Entering text by order row

Entering text by order row

(OP)
I am trying to enter free txt and on change of order row number have the correct text under the correct row (I have grouped the rows). I have created a row number in an access table (no other tables connected at all)

I am not very up on formula and this thus far but it is not working, currently it is asking for a string required at the Else IF part. Could someone advise me please how the code should be please, I intend to have up to potentially 6 rows., thanks in advance

If {Table1.Row} = 1 then

WhilePrintingRecords;
StringVar Array Input := {?Pack};
NumberVar howmany:= count (Input);

Input [1] +
if howmany > 1 then ', ' + Input [2] +
if howmany > 2 then ', ' + Input [3] +
if howmany > 3 then ', ' + Input [4] +
if howmany > 4 then ', ' + Input [5] +
if howmany > 5 then ', ' + Input [6] +
if howmany > 6 then ', ' + Input [7] +
if howmany > 7 then ', ' + Input [8] +
if howmany > 8 then ', ' + Input [9]



ELSE IF {Table1.Row} = 2 then

WhilePrintingRecords;
StringVar Array Input := {?pack2};
NumberVar howmany:= count (Input);

Input [2] +
if howmany > 1 then ', ' + Input [10] +
if howmany > 2 then ', ' + Input [11] +
if howmany > 3 then ', ' + Input [12] +
if howmany > 4 then ', ' + Input [13] +
if howmany > 5 then ', ' + Input [14] +
if howmany > 6 then ', ' + Input [15] +
if howmany > 7 then ', ' + Input [16] +
if howmany > 8 then ', ' + Input [17];

RE: Entering text by order row

I know that if you have multi-line statements in the 'then' or 'else' of a if statement, then they have to be enclosed in parens. Otherwise you will get very odd results.

RE: Entering text by order row

(OP)
Hi

Yes but it is where the then or else etc... need parens. I have tried everything going but seem to be going around in cirlces

Currently I now have my formula as below. This works fine if table1.row = 1. What I cant figure out is how to add the text so if it is table1.row = 2.
HAs anyone any ideas please and also how the formula should look. I will keep trying in the mean time and update if I get it working. Thanks

If {Table1.Row} = 1 then

(

WhilePrintingRecords;
StringVar Array Input := {?Pack}; // replace this with your string prompt
NumberVar howmany:= count (Input);

Input [1] +
if howmany > 1 then ', ' + Input [2] +
if howmany > 2 then ', ' + Input [3] +
if howmany > 3 then ', ' + Input [4] +
if howmany > 4 then ', ' + Input [5] +
if howmany > 5 then ', ' + Input [6] +
if howmany > 6 then ', ' + Input [7] +
if howmany > 7 then ', ' + Input [8] +
if howmany > 8 then ', ' + Input [9]


);

RE: Entering text by order row

(OP)
I have made a little progress but obviously the code is still incorrect.

Row 1 should be

1 Pack: 8128990 60/1.1,
 
Pack: 8128990 60/1.2,
 
Pack: 8128990 60/1.3

RE: Entering text by order row

(OP)
Sorry did not finish the post above

I have made a little progress but obviously the code is still incorrect (codes as it is shown below).

Row 1 and 2 should be

Row1 Pack: 8128990 60/1.1,
Pack: 8128990 60/1.2,
Pack: 8128990 60/1.3

ROW2 Pack: 8128990 60/1.1, (this should be Pack: 8128990 60/2.1, then 60/2.2, then 2.3for some reason it is grabbing the first row from row 1 and leaving out 2.3 of row 2)
Pack: 8128990 60/2.1,
Pack: 8128990 60/2.2

However as you can see it as picked up the fist code from Row one Pack: 8128990 60/1.1, and out it in the row 2 also.
Also other rows, 3,4,5 etc... also have the ROW2 information in them, basically if there are no more packs to add then any other row numbers should be blank.

Could someone please help with the coding on this

Thanks

RE: Entering text by order row

(OP)
Hi

I have now gone down the route of having 3 different parameter fields and 3 different formulas.

PAck1, Pack2 and Pack 3.

In the formula for each one I have the below formula but have changed it to relate to the row number and parameter name for each paramter. It works accept for, it wants an entry in the parameters and wont OK if I have not put anything in the multiple selection for each row, I can just put a space and it works but ideally I only want to be information into the rows where data is required. So does anyone know how I can set things so it will work if nothing is entered into the parameter prompt, thanks

If {Table1.Row} = 1 then

(

WhilePrintingRecords;
StringVar Array Input := {?Pack}; // replace this with your string prompt
NumberVar howmany:= count (Input);

Input [1] +
if howmany > 1 then ', ' + Input [2] +
if howmany > 2 then ', ' + Input [3] +
if howmany > 3 then ', ' + Input [4] +
if howmany > 4 then ', ' + Input [5] +
if howmany > 5 then ', ' + Input [6] +
if howmany > 6 then ', ' + Input [7] +
if howmany > 7 then ', ' + Input [8] +
if howmany > 8 then ', ' + Input [9]

ELSE ""
);


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close