"N/A" instead of "#Name?"

  • Thread starter Thread starter Pietro
  • Start date Start date
P

Pietro

Hi ,

I'm changing my form recordsource through a button,sometimes the siurce
i'm changing to does not contain all the fields that already exist on my form.
I want to that the box that does not have a control source displays "N/A"
instead of "#Name?"
How can i do this ?
 
Pietro said:
Hi ,

I'm changing my form recordsource through a button,sometimes the siurce
i'm changing to does not contain all the fields that already exist on my
form.
I want to that the box that does not have a control source displays
"N/A"
instead of "#Name?"
How can i do this ?


Use an expression in your SQL statement or saved query that returns the
literal value "N/A" and an alias that matches the field name. For example
....

If SomeCondition Then
Me.RecordSource = "SELECT SomeField, AnotherField FROM SomeTable"
Else
Me.RecordSource = "SELECT SomeField, 'N/A' AS AnotherField FROM
SomeTable"
End If
 

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

Back
Top