Query by Form

Lyncroft

QPR for ever
Local time
Today, 11:30
Joined
May 18, 2002
Messages
168
I've set up a query by form where the results appear in normal datasheet form. Is there a way to make the results noneditable to stop users mucking around with results.

Any ideas gratefully received.
 
In the form design view, set the Allow Edits to No (In Data tab). You can also do this dynamically with code if you wish to turn on/off editing via certain conditions.
 
Cheers Fizzio, the thing is though the results don't appear in a form. I've used the "Create dynamic query" as on the Microsoft website. The results just appear like a normal select query. Its not a major problem really I guess.
 
You can force a query to be non-updateable by turning it into a cartesian product. Create a new table with a single field. Add this new table to your query without specifying a join type.

Select ...
From YourTable, YourDummyTable;
 
Thanks for that Pat. You mention creating a single field table. What would I call that field?

My last bit of code is

MsgBox "Select * from tblCert " & (" where " + Mid(where, 6) & ";")
Set QD = db.CreateQueryDef("Dynamic_Query", _
"Select * from tblCert " & (" where " + Mid(where, 6) & ";"))
DoCmd.OpenQuery "Dynamic_Query"
End Sub

Where exactly would I put the code you mention?

Thanks
 
It doesn't matter what you call it since you are not actually going to reference it.

"Select * from tblCert, tblDummy " & (" where " + Mid(where, 6) & ";"))
 
Whoops - I followed your instructions Pat and whenever I ran the query I go no results showing at all.
 

Users who are viewing this thread

Back
Top Bottom