Have to close my query in Microsoft Access 2013 each time I want to run a form -
every time want run form searches through database , returns results based on fields (login name, date, etc.) must close out of query if want change search criteria. example, if search login name "john" results, if want search "jerry" have close out of query data first, re-run form.
is there anyway around this?
--this applies both close , opening method.
--same applies object(s) not query form etc.
to close query can use following code.
docmd.close acquery, "queryname", acsaveno
to explain better,
docmd.close method
it accepts following parameters.
- what close (object type:acquery, acform etc)
- name of object (in case query name)
- action perform when closing (acsaveyes,acsaveno,acsaveprompt).
remember: saving saving object(in case query) not data. avoid accidental modification of query.i recommend closing object without saving (unless required , know doing)
acsaveyes: save form out notification. not saving data, saving object. recommend not doing unless want users modify query.
acsaveno: close query without saving.if have users view data , don't modify query useful.
acsaveprompt: prompting either save object or not.
quick tip: while writing query, if intellisense works means cold valid.
ref:https://msdn.microsoft.com/en-us/library/office/ff192860%28v=office.15%29.aspx
Comments
Post a Comment