It expects an equal sign because when you use brackets you are calling a function.
x = DoCmd.OpenQuery("DateWellPrevious")
Use this (and without the optional parameters too):
DoCmd.OpenQuery "DateWellPrevious"
thanks for the reply.
Thanks very much for the reply. At least now I know its not possible.
Pardon for my lack of access terminology. When I said table I actually meant datasheet. This datasheet has the newly created query as a source.
You are right. If I didn't delete the query everytime...
Hello group,
I am currently working on a project on MS Access using forms and VBA. What I'm doing at the moment is:
- creating a new query using CurrentDB.CreateNewQueryDef
- changing it's SQL using my form values as parameters
- changing the subform's SourceObject to "CreatedQuery"
- deleting...
Thanks so much for the response. What it seems is I'm really stuck with DAO.
Why is it not under my libraries. Is this something I should install, or is it already there? Why doesnt Access recognize the library, say:
Dim asd As DAO.Recordset ' syntax error
thanks again
tim
Hi there,
I have a question regarding accessing databases using VBA from Access forms. All the tutorials I have found are either way too basic or they have overwhelming amount of info (I tend to lose focus with the later ones). Basically all I am looking for is this:
- Connecting to and using...
DAO Library? where can I find this. How do you use one?
It appears that there is no DAO library in both of my computers (work and home). Or maybe I'm a bit clueless about what DAO really is.
Can you give me an example on how you use a DAO library?
I was thinking maybe it should be on there...
Thanks so much, but not quite there yet
Sounds like a good example. I could not make it work though. And thats because I can't find any DAO library in my VBA. Do you have any idea why my access has no DAO library. It does have ADODB but thats about it.
Thanks so much
P.S. Sorry I'm new to...
Hello guys,
I am trying to search using 2 fields (First and Last name). I have no idea how to execute any SQL (which im sure is silly). So im using this code in a form:
DoCmd.ShowAllRecords
DoCmd.GoToRecord , , acFirst
If strLast <> "" Then
DoCmd.GoToControl "Last Name"...