Function
-
- Administrator
- Posts: 78532
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Function
In general, if you want to call a function in a query, that function should be in a standard module, not in a form module.
There are ways to get around this, but I don't recommend that.
There are ways to get around this, but I don't recommend that.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 550
- Joined: 30 Jul 2014, 23:58
Re: Function
The function is from the form. It is called via cmd btn and then populates the form. I was curious if I could get those results into a qry and if so how?
-
- Administrator
- Posts: 78532
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Function
That doesn't make sense to me. Just create a query to return the results you want.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 550
- Joined: 30 Jul 2014, 23:58
Re: Function
No, the function is quite complex and of course can be called from anywhere.
Set rsjob = db.OpenRecordset(strjob, dbOpenDynaset)
Set rsemp = dbOpenRecordsetb(strEmp, dbOpenDynaset)
tblJobs tblEmployees
Set rsjob = db.OpenRecordset(strjob, dbOpenDynaset)
Set rsemp = dbOpenRecordsetb(strEmp, dbOpenDynaset)
tblJobs tblEmployees
-
- Administrator
- Posts: 78532
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Function
You cannot just "get those results into a qry". Access doesn't work that way.
You might use the code to create or populate a temporary table, and then use that table for whatever you want to do.
You might use the code to create or populate a temporary table, and then use that table for whatever you want to do.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 550
- Joined: 30 Jul 2014, 23:58
Re: Function
Ok. That's what I needed to know. Thank You.