Disable autosave (again)? (1 Viewer)

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 09:03
Joined
Sep 12, 2006
Messages
15,613
@rashu

my observation was directed at the original post, but I then realised it was 5 years old!
 

rashu248

Registered User.
Local time
Today, 13:03
Joined
Nov 7, 2016
Messages
10
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
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 20:03
Joined
Jan 20, 2009
Messages
12,849
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?
 

rashu248

Registered User.
Local time
Today, 13:03
Joined
Nov 7, 2016
Messages
10
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: 84
Last edited:

rashu248

Registered User.
Local time
Today, 13:03
Joined
Nov 7, 2016
Messages
10
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: 94
  • Query.png
    Query.png
    21.8 KB · Views: 74
  • VBA.png
    VBA.png
    6.6 KB · Views: 73

Galaxiom

Super Moderator
Staff member
Local time
Today, 20:03
Joined
Jan 20, 2009
Messages
12,849
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.
 

rashu248

Registered User.
Local time
Today, 13:03
Joined
Nov 7, 2016
Messages
10
Sorry Glaxiom,


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

Plz.....
 

Attachments

  • TransactedBoundForm.mdb
    1.8 MB · Views: 83

Users who are viewing this thread

Top Bottom