Hide #Name? until find record

S

Song Su

I have a SearchForm with subform. I don't want to display any record until
user find the record through cbobox and I will provide RecordSource with
where condition in my code just display that one record. So in the design
view, I deleted SecordSource in data tab. When I open the form, there is no
record, that's good. However, all the fields in my SearchForm display
'#Name?' which does not look good.

How to hide these #Name?
 
K

Ken Snell \(MVP\)

I assume you're saying that the "#Name?" is showing in the subform's record?
That suggests that you have no RecordSource for the subform when you first
open the form and that the bound controls can't associate to the right
fields?

If yes, use a RecordSource that includes the correct fields, but also use a
WHERE clause that won't return any reords, for the initial RecordSource that
your search code can replace, such as:

SELECT * FROM Tablename
WHERE 1=0;

Or, alternatively, make the subform invisible until you've set its
RecordSouece, then make it visible.
 

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