473,804 Members | 3,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "qryCaseFil es",
acViewNormal, acEdit
DoCmd.Close acForm, "frmRecordSearc h"
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 1557
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!frmRecord Source!txtCaseN umb
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*********@ea rthlink.net> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.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 "qryCaseFil es",
acViewNormal, acEdit
DoCmd.Close acForm, "frmRecordSearc h"
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
"qryCaseFil es",
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
2235
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 objects. That's not really that clear, so here's an example: If I have a table named "table_i_would_like_to_delete_but_don't_know_if_any_object_is_using_it",
0
1082
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 linked into the query and has the same fields as the query. I would like to use my form as a way of searching for records by typing in text in the appropriate text boxes on the form. Currently, I can link the form fields into the query, however,...
1
1270
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 linked into the query and has the same fields as the query. I would like to use my form as a way of searching for records by typing in text in the appropriate text boxes on the form. Currently, I can link the form fields into the query, however,...
3
3216
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 container form) or if the MDI child form's Visible property is set to False (after the MDI child form was shown). This is an enormous problem for my app because I must show different MDI child forms based on the state of my application and many of the...
6
8308
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 that would be nice to put into folders for organizational reasons. I assume not but thought this would be the place to ask. If not does anyone know how you would send Microsoft a suggestion? Or is this a rediculous idea?
5
4791
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 vlaues. Meaning if I enter a new table or form, the list box needs to show it. Any help is much appreciated. :) Thanks
2
1656
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 first record entered by the user (continuous forms). However in the second record, cbo2 shows the values influenced by cbo1 in the first record, rather than the 2nd record (i.e. it doesn't update). My problem may be that both combo boxes have...
2
1997
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" the database... but instead of an Access Front End... have an ASP front end? Thanks for any help.
9
1634
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 much, but it is definitely a huge step in the right direction. Bruce Lawson of The Web Standards Project seems optimistic albeit a
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9130
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.