Change A Field content to spaces

  • Thread starter Dexter via AccessMonster.com
  • Start date
D

Dexter via AccessMonster.com

Hi,
I have a transfer text routine to transfer the contents of a query to a text
file. In that file is a field name cost_ctr that has the word "none" in it.
How do I change "none" to spaces for the output file only? I still want to
keep it in the query for reporting purposes.

Thanks for your help.

Dexter
 
D

Dexter via AccessMonster.com

Hi Jeff,

Not sure how to do this....

create a query against the table, then to overwrite/replace that field with a
space,
on the field cost_ctr write: IIF () cost_ctr = "none", ' ':

Please help me with syntax. I've never done this before.

Thanks,

Jeff said:
Dexter

Create a query against the recordset. Use an IIF() expression to change
"none" to "..." (you didn't say how many spaces). Export this new query.
Hi,
I have a transfer text routine to transfer the contents of a query to a text
[quoted text clipped - 5 lines]
 
J

Jeff Boyce

Check Access HELP for specifics on the syntax of IIF() and examples.

It will look something like:
Expr1: IIF([YourField]="none"," ",[YourField])

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

Dexter via AccessMonster.com said:
Hi Jeff,

Not sure how to do this....

create a query against the table, then to overwrite/replace that field with a
space,
on the field cost_ctr write: IIF () cost_ctr = "none", ' ':

Please help me with syntax. I've never done this before.

Thanks,

Jeff said:
Dexter

Create a query against the recordset. Use an IIF() expression to change
"none" to "..." (you didn't say how many spaces). Export this new query.
Hi,
I have a transfer text routine to transfer the contents of a query to a
text
[quoted text clipped - 5 lines]
 
D

Dexter via AccessMonster.com

Hi,
I used in my query on column cost-ctr:
IIf ([cost-ctr]="none"," ",[cost-ctr])

But in my output file, it removes the record from the query. I want to leave
"none" in the table, but move space to the cost-ctr field on my output file.
I'm using the Docmd.transferText on my button on the form. my output file is
working, but i just need to move spaces to cost-ctr field if it contains
"N/A"

Can this be done?

thanks,
Dexter

Jeff said:
Check Access HELP for specifics on the syntax of IIF() and examples.

It will look something like:
Expr1: IIF([YourField]="none"," ",[YourField])
[quoted text clipped - 18 lines]
 
J

Jeff Boyce

Perhaps we have differing definitions of "output file".

One way in Access to output something is to create a query, like the one I
suggested containing the converting IIF() function. Then export that query
(making that the "output file").

What definition are you using?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

Dexter via AccessMonster.com said:
Hi,
I used in my query on column cost-ctr:
IIf ([cost-ctr]="none"," ",[cost-ctr])

But in my output file, it removes the record from the query. I want to leave
"none" in the table, but move space to the cost-ctr field on my output file.
I'm using the Docmd.transferText on my button on the form. my output file is
working, but i just need to move spaces to cost-ctr field if it contains
"N/A"

Can this be done?

thanks,
Dexter

Jeff said:
Check Access HELP for specifics on the syntax of IIF() and examples.

It will look something like:
Expr1: IIF([YourField]="none"," ",[YourField])
[quoted text clipped - 18 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top