473,385 Members | 2,003 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,385 software developers and data experts.

Parameter query that launches twice

Hello everyone:

First and foremost: I find this case below difficult to explain so let me hereby present my apologies if someone's willing to help but does not understand what is all this thing about...Just let me know and I will try to explain it better.
I've got a form with a list box. The list box type is that in which the data for the record selected automatically appears in the form. The records (ctrl source) come from a parameter query, so that the records showing in the form are filtered via the parameter query.
The problem is that the query launches twice: for the list box and for the form and the user is prompted to type the data twice. If only the first msgbox is filled, then only data for the list box appear; if it is the second msgbox the one filled, then the data appears for the form but the list box remains blank. If both msgboxs are filled, data appear for both the list box and the form. How do I manage to get only one msgbox appearing but getting data for both the list box and the form?

Best regards!!
May 29 '08 #1
1 2187
puppydogbuddy
1,923 Expert 1GB
Hello everyone:

First and foremost: I find this case below difficult to explain so let me hereby present my apologies if someone's willing to help but does not understand what is all this thing about...Just let me know and I will try to explain it better.
I've got a form with a list box. The list box type is that in which the data for the record selected automatically appears in the form. The records (ctrl source) come from a parameter query, so that the records showing in the form are filtered via the parameter query.
The problem is that the query launches twice: for the list box and for the form and the user is prompted to type the data twice. If only the first msgbox is filled, then only data for the list box appear; if it is the second msgbox the one filled, then the data appears for the form but the list box remains blank. If both msgboxs are filled, data appear for both the list box and the form. How do I manage to get only one msgbox appearing but getting data for both the list box and the form?

Best regards!!
I believe your form query does not point back to the selection made in the listbox like it should. This is usually done in the AfterUpdate event of the listbox. to get a better understanding of what I am talking about, see the following link to a HowTo, step by step tutorial for a listbox search form with a downloadable demo mdb file.

http://www.databasedev.co.uk/list_box_searching.html

Note that although the example is slightly different in that the AfterUpdate event of the listbox is used to enable a button and the button click event is used to update the form, the principle is still the same ...the query that updates the form contains a parameter that has the selection made from the listbox as shown below:
Expand|Select|Wrap|Line Numbers
  1. "[tblSalespersonContact.strSalespersonID]=" & _
  2.                    "'" & Me.lstSearch.Column(0) & "'"
May 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Christine | last post by:
I am struggling to learn to use Access almost on my own, and have written a query that needs to have a parameter. The query I wrote includes in the Criteria of the design view, under the column...
2
by: Christine Brandel | last post by:
The code for the query I have written is: SELECT .,.,.,. FROM dbo_census WHERE (((.)=))); That code results in the parameter value request being made twice before the information I want...
3
by: Lynn A. | last post by:
Access/Word 2000 I am trying to merge a word document with an access query that has a parameter attached to it. Could someone please suggest how to stop the parameter from appearing when the...
2
by: HateSpam | last post by:
I have a paramter query that wants either of 2 date fields in a table to be before a certain date. Select * from tblExample where Date1 < or Date2 < When I open this query, it prompts me...
2
by: Matt W via AccessMonster.com | last post by:
I based my parameter query off the following posting, but can't seem to work out a little kink. I cannot bring up a report without first typing in the month and year three times. The first time for...
2
by: Miguel | last post by:
I have followed the advice noted throughout this group for capturing parameter values in a report header. It works, but the parameter dialog box appears twice,once for the query and once for the...
1
by: ShadesOfGrey | last post by:
Hello again. Thanks to Gord, I have this cool query that puts my student attendance records in a calendar format in Access 2003. PARAMETERS Text ( 255 ), IEEEDouble; TRANSFORM...
1
by: yoursteveis | last post by:
Dear all, I have created a main report (for monthly purchase summary) and a sub report (for monthly sales summary). I have linked main report with a parameter query (i.e. purchasesummary1) and...
3
by: yiotie | last post by:
Hi Each time i run a Query ' find customer by Name " I must enter the customer's name twice to get the results. I dblclk the Query, the parameter field appears asking for the customer's name, i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.