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

Dialog Box Not Dialogging

After many hours of frustrating attempts and twists to get a dialog
box to work as intended, I turn to the resident gurus of MSAccess
matters for assistance. I'll try to make this quick and painless as
possible.

The Access 97 database has a Dialog Box (frmDialog) and an unbound
Combo Box although the reverse produced the same results (cboName).
The Row Source is: Select DistinctRow qryOrders.CoName From qryOrders
Order By qryOrders.CoName. I have changed the order and names many
times and also used different tables and queries, but no change in
outcome.

The OK command button on frmDialog has an event procedure behind as
follows:
Dim strWhere As String
If Not IsNull(Me.cboName) Then
strWhere = "qryOrders" = " & Chr(34) & Me.cboName & Chr(34)
End If
docmd.OpenReport "Orders", acViewPreview,,strWhere

The report Record Source uses the same query and on the OnOpen event
procedure the following code used:
Dim strDocName As String
strDocName = "frmDialog"
docmd.openForm strDocName,,,,,acDialog
docmd.Close acForm, strDocName

The combo box does list all companies and if left blank (no selection
in box), and after clicking OK button the report appears with all data
- looks fine. However, if a specific company is selected, there is an
Enter a Parameter Value popup box displayed that shows the name of the
query (qryOrders) or table used (this is the problem). Have tried
several different ones, no change. Have no clue what it is asking for
and it should not be displayed anyway. Doesn't matter if a value is
provided or not as the preview of the report is blank.

I know that the above does work as I had used it several months ago on
another database. But why it fails to work on a different one is worth
finding out. Any assistance will be appreciated. Thanks, Dalan
Nov 12 '05 #1
2 1335
Dalan wrote:
strWhere = "qryOrders" = " & Chr(34) & Me.cboName & Chr(34)


The line above is the culprit.

When you pass a clause, it lacks the word Where. But it should be a value
statement,

Let's say I had a list of names in a combo. Let's say the table field
name was FirstName. I selected Dalan. My where clause would be
strName = "Dalan"
:strWhere = "FirstName = """ & strName & """

That's 3 double quosts

Yours could be "COName = """ & cbo.Name & """

or you could use single quotes
"COName = ' " & cbo.Name & " ' "

I put spaces between the quote letters to highlight the diference. You
can use the single quote method if you're sure double/single quotes are
used in the field.

If you do have single/double quotes in names that adds some more work.

Nov 12 '05 #2
I also believe he's omitting a field name in the 'culprit' string. qryOrders
is the name of a query is it not? If so, it can't equal anything.
It's asking for a parameter because it does not recognize qryOrders as a
data field in wich to look.
Maybe I'm wrong?

Mike Storr
www.veraccess.com
"U N Me" <un**@together.com> wrote in message
news:3F***************@together.com...
Dalan wrote:
strWhere = "qryOrders" = " & Chr(34) & Me.cboName & Chr(34)


The line above is the culprit.

When you pass a clause, it lacks the word Where. But it should be a value
statement,

Let's say I had a list of names in a combo. Let's say the table field
name was FirstName. I selected Dalan. My where clause would be
strName = "Dalan"
:strWhere = "FirstName = """ & strName & """

That's 3 double quosts

Yours could be "COName = """ & cbo.Name & """

or you could use single quotes
"COName = ' " & cbo.Name & " ' "

I put spaces between the quote letters to highlight the diference. You
can use the single quote method if you're sure double/single quotes are
used in the field.

If you do have single/double quotes in names that adds some more work.

Nov 12 '05 #3

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

Similar topics

1
by: Prosonman | last post by:
Hi, What is the best way to transfer variables to and from a dialog box? My project consists of a form with a number of controls, lets say three Labels, when a label is clicked it opens a dialog...
23
by: George | last post by:
Is there a way to customize the open file common dialog? I am trying to modify the button text so I can create a delete file common dialog. I need the same functionality of the open file common...
1
by: Carmine | last post by:
I'm currently writing a small program that churns on a repetitive task while displaying a progress & cancel modeless dialog. I've been having problems due to threadlocking, and I was wondering if...
4
by: Alexander | last post by:
Hi, I have written a program that takes on some operations much more time than I expected. As I have seen users clicking wildly on the screen to make something happen, I want to follow the...
6
by: bryanhobson | last post by:
I'm fairly new to c#, and I am just trying to work out how a 'properties' dialog works. Currently in my code, I have an object represented by the class 'Dog'. The dog object has several...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
11
by: Zytan | last post by:
I have created a new form from the main form. When I close the main form with the 'x' close button, its Form.FormClosed event is run, but not the dialog's. Is this normal? It is ok /...
0
by: Moezzie | last post by:
So ive got a bit of a problem here. Ive been searching the net about this for quite some time now but i just cant seem to figure out how to open a dialog that ive made in QtDesigner. Of corse i...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
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
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
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,...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.