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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enter any text into Expression builder 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
We have report that part of it is using an expression builder.
It is using a temp table to populate fields on the report. Part of it always puts the letter F after the [Pack Number]

=[Pack Number] & "/F"

Is there away I can get it so it allows a user to put another letter in rather than always F.

Any help please?
 
Your report is based on a Record Source which could be a query with a column defined like:

AltLetter: Nz([Enter A Letter],"F")

When the query is run to populate the report, the user will be prompted to Enter A Letter. If they don't enter anything, the column will return "F". Otherwise the column will return the letter they type.

Duane
Hook'D on Access
MS Access MVP
 
HI

Sorry I do not understand your solution.

the record source is a temptable, how would apply your solution
 
Change your report's record source to a query based on your temp table. You can then add the column I suggested:

SQL:
SELECT Nz([Enter A Letter],"F") as AltLetter, *
FROM [Your Temp Table Name];


Duane
Hook'D on Access
MS Access MVP
 
Hi

after abit more investigation I believe the report is using a query, this is the sql from it

SELECT Pack.Date, 1 AS [Pack Number], Pack.WONO, Pack.FP, Pack.W, Pack.T, Pack.L, Pack.PPP, Pack.R, Pack.Op, Pack.PI, Pack.S, Pack.Ex, Pack.TM, Pack.TP, [PPP]*[L] AS M, [M]*([w]/1000)*([t]/1000) AS V, [T] & "x" & [W] AS FS INTO Temp
FROM Pack
WHERE (((Pack.Date) Is Null));

This is called maketempquery.

Where would I insert your code for this to work?

Thanks
 
Cpreston,
What you provided is an action query that creates a table named Temp. The record source of your report should be
SQL:
SELECT Nz([Enter A Letter],"F") as AltLetter, *
FROM [Temp];

In your report, change the text box control source to:
Code:
=[Pack Number] & "/" & [AltLetter]


Duane
Hook'D on Access
MS Access MVP
 
Hi

Sorry really do not understand, where do I actually put this

SELECT Nz([Enter A Letter],"F") as AltLetter, *
FROM [Temp];

Thanks
 
You must go to your report design and find the Record Source property. It might have Temp at this point but needs to be changed to:

SELECT Nz([Enter A Letter],"F") as AltLetter, * FROM [Temp];

Duane
Hook'D on Access
MS Access MVP
 
Hi

Think I have it working, thanks for the help. Just getting the people using it to test it but appears to have done the job.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top