Disable autosave (again)?

@rashu

my observation was directed at the original post, but I then realised it was 5 years old!
 
Dear,
Its working good in my Db, but have 2 doubts.

1, The same function how will work with data entry = yes.
(Because i want to open the entry form except existing records.)

2, How to change Record source selection from 'Table' to 'Query
(Because i need to change the Record source to 'query'. which i made
a query focusing with criteria.)


I think below have to make some changes. please help me


Private Sub Form_Open(Cancel As Integer)

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb

Set rs = db.OpenRecordset("SELECT * FROM 1", dbOpenDynaset)
Set Me.Recordset = rs

End Sub
 
There is very little difference between tables and queries so I expect no problem.

I suspect it will be fine with data entry too but why not just try it yourself and tell us how it goes?
 
I tried many times, but i can't

Normal query its OK working good.
but the problem is when i set criteria to query, its appearing error msg.

MyChanges as below;
Private Sub Form_Open(Cancel As Integer)

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * FROM NewStoreQry", dbOpenDynaset)
Set Me.Recordset = rs
End Sub
 

Attachments

  • AutoSave2.png
    AutoSave2.png
    6.6 KB · Views: 112
Last edited:
Run-time error '3061'
Too few parameters. Expected 1.



and please find 3 attachments for easy references.
 

Attachments

  • Form.png
    Form.png
    31.4 KB · Views: 126
  • Query.png
    Query.png
    21.8 KB · Views: 105
  • VBA.png
    VBA.png
    6.6 KB · Views: 102
Run-time error '3061'
Too few parameters. Expected 1.

Your query has a parameter (eg a reference to a control on a form). These objects are not within the scope of the database engine where Recordsets are generated.

Either you must append a parameter to the query or generate a dynamic query string by concatenating the parameter into the SQL string.
 
Sorry Glaxiom,


Can you show me, How to solve and rectify this errors on attached db
(which was made by you)

Plz.....
 

Attachments

Users who are viewing this thread

Back
Top Bottom