473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dialogs & Queries & Forms, **OH MY** Help!!

Ok here's my problem....

I have a custom dialog box that allows the user to enter information to
run a Parameter Query. This works GREAT, but I need that query to show
as a form, not just the basic query screen. I have created the form,
but how in the world do I get it to open based on the parameter query
created by the user.

Ugg... ok now even I'm confused... what a tangled web we weave...
GRRRRR

To simplify...

1) user opens frmRecordSearch

2) user enters the paramiters for the query, ie. ClientID or CaseNumb,
and clicks ok

3) the ok button runs the Query using the following code:
Private Sub cmdOK_Click()
DoCmd.OpenQuery "qryCaseFiles",
acViewNormal, acEdit
DoCmd.Close acForm, "frmRecordSearch"
End Sub
4)User see's the query results...

How can I display the results in a form not the query window???

Mar 30 '06 #1
3 1533
Set the form to Continuous View, so it shows one record per row.

Put the unbound controls where the user enters their search parameters into
the Form Header section.

Put the name of the query into the RecordSource of the form.

In the Criteria of the query, enter things like:
Forms!frmRecordSource!txtCaseNumb
where txtCaseNumb represents the name of the unbound text box on the form.

There are actually some limitations to that simple approach, e.g. where you
don't want to use all the search boxes, or where the query is not able to
find the boxes on the form when it first opens. A more powerful solution is
leave the criteria out of the query, and build up a string to use as the
Filter of the form. This is much more flexible and efficient, but does
require some VBA skills. You can download an example for Access 2000 and
later here:
http://allenbrowne.com/unlinked/Search2000.zip

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Marina" <ma*********@earthlink.net> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
Ok here's my problem....

I have a custom dialog box that allows the user to enter information to
run a Parameter Query. This works GREAT, but I need that query to show
as a form, not just the basic query screen. I have created the form,
but how in the world do I get it to open based on the parameter query
created by the user.

Ugg... ok now even I'm confused... what a tangled web we weave...
GRRRRR

To simplify...

1) user opens frmRecordSearch

2) user enters the paramiters for the query, ie. ClientID or CaseNumb,
and clicks ok

3) the ok button runs the Query using the following code:
Private Sub cmdOK_Click()
DoCmd.OpenQuery "qryCaseFiles",
acViewNormal, acEdit
DoCmd.Close acForm, "frmRecordSearch"
End Sub
4)User see's the query results...

How can I display the results in a form not the query window???

Mar 30 '06 #2
An alternative -

A - assuming that the new form with the query on it is called
"MynewQuery form"

3) the ok button runs the Query using the following code:
Private Sub cmdOK_Click()
' DoCmd.OpenQuery
"qryCaseFiles",
DoCmd.Openform "MynewQuery form"
There are other parameters to openform that will show up and you can
use whatever of those that you want.

Ron

Mar 30 '06 #3
thank you, thank you, thank you!!!

Mar 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jonathan LaRosa | last post by:
Hi all - I'm wondering if anyone has (or knows of) a tool that will allow me to search through VB code, tables, queries, reports, forms, and other objects, for references to all other types of...
0
by: Andy | last post by:
Hello everybody I have a question on running queries via a form. My situation is – a have a query (qrysearch) and this query has a number of fields e.g. (company, employee etc). My form is...
1
by: Andy | last post by:
Hello everybody I have a question on running queries via a form. My situation is – I have a query (qrysearch) and this query has a number of fields e.g. (company, employee etc). My form is...
3
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI...
6
by: Rob Williamson | last post by:
Does anyone know whether there is a way to create folders inside the right payne when you click on Tables or Queries or Forms or Reports in the the Objects side. I have alot of queries and forms...
5
by: isetea | last post by:
Hi, is there any VBA code I can try to get all tables, queries and forms of my database selected and displayed in a list box of a form? And also the list box must be always held the current...
2
by: lottaviano | last post by:
I have a form with two combo boxes. The value chosen in the first combo box (cbo1) is supposed to change the values that appear in the second combo box (cbo2). This currently works great for the...
2
by: MyEmailList | last post by:
We have an Access data base with severl tables, queries and forms. We want to put it on the web. Is there a tool that will convert the Access queries and forms to ASP? Sorta like "splitting"...
9
by: -Lost | last post by:
http://blogs.msdn.com/ie/archive/2007/12/19/internet-explorer-8-and- acid2-a-milestone.aspx Oh my! A somewhat standards compliant Internet Explorer? What about JavaScript? Not that it proves...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.