A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Create a Query Form



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2006, 03:31 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Create a Query Form

I have an application that is completely forms driven and I need to allow
users to create ad-hoc queries.

Does anyone have have suggestions or examples that I can reference?

Thanks in advance!

Dwight
  #2  
Old May 4th, 2006, 04:22 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Create a Query Form

Not sure if that what you mean, but you can try something like:
Create a query, and use the code to change the sql within this query, and
then run it.
' To change the SQL in the Query
Application.CurrentDb.QueryDefs("Queryname").SQL = "Select * From TableName"
Docmd.OpenQuery "Queryname"

--
Good Luck
BS"D


"Dwight" wrote:

I have an application that is completely forms driven and I need to allow
users to create ad-hoc queries.

Does anyone have have suggestions or examples that I can reference?

Thanks in advance!

Dwight

  #3  
Old May 4th, 2006, 04:31 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Create a Query Form

I want to create a form which allows a user to create a query against the
tables in the database. The form needs to allow the user to select the
tables and fields, set criteria, sort, join, basically everything that can be
done within the MS Access query design window.

Thanks!

"Ofer Cohen" wrote:

Not sure if that what you mean, but you can try something like:
Create a query, and use the code to change the sql within this query, and
then run it.
' To change the SQL in the Query
Application.CurrentDb.QueryDefs("Queryname").SQL = "Select * From TableName"
Docmd.OpenQuery "Queryname"

--
Good Luck
BS"D


"Dwight" wrote:

I have an application that is completely forms driven and I need to allow
users to create ad-hoc queries.

Does anyone have have suggestions or examples that I can reference?

Thanks in advance!

Dwight

  #4  
Old May 4th, 2006, 04:48 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Create a Query Form

In that case using the example I gave you you can do something like

Application.CurrentDb.QueryDefs("Queryname").SQL = "Select " & Me.FieldsName
& " From " & Me.TableName & " Order By " & Me.SortFieldName
Docmd.OpenQuery "Queryname"

I hope that this example gives you an idea

--
Good Luck
BS"D


"Dwight" wrote:

I want to create a form which allows a user to create a query against the
tables in the database. The form needs to allow the user to select the
tables and fields, set criteria, sort, join, basically everything that can be
done within the MS Access query design window.

Thanks!

"Ofer Cohen" wrote:

Not sure if that what you mean, but you can try something like:
Create a query, and use the code to change the sql within this query, and
then run it.
' To change the SQL in the Query
Application.CurrentDb.QueryDefs("Queryname").SQL = "Select * From TableName"
Docmd.OpenQuery "Queryname"

--
Good Luck
BS"D


"Dwight" wrote:

I have an application that is completely forms driven and I need to allow
users to create ad-hoc queries.

Does anyone have have suggestions or examples that I can reference?

Thanks in advance!

Dwight

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Customers- Contracts form problem GL Using Forms 10 February 7th, 2006 04:05 PM
Date range on reports Mark_Milly Setting Up & Running Reports 10 January 19th, 2006 03:49 PM
Toolbars, Drop-Down Menus Rick New Users 1 September 21st, 2005 11:17 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Display Parameter from Form on Report sara Setting Up & Running Reports 10 July 19th, 2004 04:54 PM


All times are GMT +1. The time now is 05:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.