I am tired, as I have done this or similar things many times, I am not seeing the problem here.
I will run a query producing the following SQL -
-
SELECT tblInterviewRecord.FaceToFaceReasonID, tblInterviewRecord.InterviewtypeID, tblInterviewRecord.ContactDate, tblEmployees.Initials, tblInterviewRecord.ServiceTypeID, tblFaceToFaceReason.FaceToFaceReason
-
FROM tblEmployees INNER JOIN (tblInterviewRecord INNER JOIN tblFaceToFaceReason ON tblInterviewRecord.FaceToFaceReasonID = tblFaceToFaceReason.FaceToFaceReasonID) ON tblEmployees.EmployeeID = tblInterviewRecord.EnteredBy
-
WHERE (((tblInterviewRecord.InterviewtypeID)=2) AND ((tblInterviewRecord.ContactDate)>=[Forms]![frmProductivity]![txtStartDate] And (tblInterviewRecord.ContactDate)<=[Forms]![frmProductivity]![txtEndDate]) AND ((tblEmployees.Initials)=[Forms]![frmProductivity]![cboInitials])) OR (((tblInterviewRecord.FaceToFaceReasonID)=3) AND ((tblInterviewRecord.InterviewtypeID)=1) AND ((tblInterviewRecord.ContactDate)>=[Forms]![frmProductivity]![txtStartDate] And (tblInterviewRecord.ContactDate)<=[Forms]![frmProductivity]![txtEndDate]) AND ((tblEmployees.Initials)=[Forms]![frmProductivity]![cboInitials]));
-
And the code of the button to run the Query is this: - Private Sub cmdRunQuery_Click()
-
On Error GoTo Err_cmdRunQuery_Click
-
-
Dim stDocName As String
-
stDocName = "qryProductivity2Query"
-
-
DoCmd.OpenQuery stDocName
-
-
Exit_cmdRunQuery_Click:
-
Exit Sub
-
-
Err_cmdRunQuery_Click:
-
MsgBox Err.Description
-
Resume Exit_cmdRunQuery_Click
-
-
End Sub
-
I have seen the term dialog form, but not sure what is meant. Should I construct it differently than any other form, ie I used the employee table as base for form, but really dont need a base, just assumed I needed something.
I ran the query with manual input and it runs fine and returns correct data, which means it is something not connecting with the input to the form.
thanks for any help
Ken
3 1565
I am tired, as I have done this or similar things many times, I am not seeing the problem here.
I will run a query producing the following SQL
(CODE)
SELECT tblInterviewRecord.FaceToFaceReasonID, tblInterviewRecord.InterviewtypeID, tblInterviewRecord.ContactDate, tblEmployees.Initials, tblInterviewRecord.ServiceTypeID, tblFaceToFaceReason.FaceToFaceReason
FROM tblEmployees INNER JOIN (tblInterviewRecord INNER JOIN tblFaceToFaceReason ON tblInterviewRecord.FaceToFaceReasonID = tblFaceToFaceReason.FaceToFaceReasonID) ON tblEmployees.EmployeeID = tblInterviewRecord.EnteredBy
WHERE (((tblInterviewRecord.InterviewtypeID)=2) AND ((tblInterviewRecord.ContactDate)>=[Forms]![frmProductivity]![txtStartDate] And (tblInterviewRecord.ContactDate)<=[Forms]![frmProductivity]![txtEndDate]) AND ((tblEmployees.Initials)=[Forms]![frmProductivity]![cboInitials])) OR (((tblInterviewRecord.FaceToFaceReasonID)=3) AND ((tblInterviewRecord.InterviewtypeID)=1) AND ((tblInterviewRecord.ContactDate)>=[Forms]![frmProductivity]![txtStartDate] And (tblInterviewRecord.ContactDate)<=[Forms]![frmProductivity]![txtEndDate]) AND ((tblEmployees.Initials)=[Forms]![frmProductivity]![cboInitials]));
(/CODE)
And the code of the button to run the Query is this:
(CODE)
Private Sub cmdRunQuery_Click()
On Error GoTo Err_cmdRunQuery_Click
Dim stDocName As String
stDocName = "qryProductivity2Query"
DoCmd.OpenQuery stDocName
Exit_cmdRunQuery_Click:
Exit Sub
Err_cmdRunQuery_Click:
MsgBox Err.Description
Resume Exit_cmdRunQuery_Click
End Sub
(/CODE)
I have seen the term dialog form, but not sure what is meant. Should I construct it differently than any other form, ie I used the employee table as base for form, but really dont need a base, just assumed I needed something.
I ran the query with manual input and it runs fine and returns correct data, which means it is something not connecting with the input to the form.
thanks for any help
Ken
A dialog form is just that, a form that "carries on a dialog with the user" in the form of prompts that require responses from the user.
In regards to your query, you did not speifically state what happens when the code runs, And when you say it runs correctly with manual input.....are you getting prompted to enter something? What happens exactly?
This portion of your select list in your SQL statement looks incorrect:
tblFaceToFaceReason.FaceToFaceReason <<<<<should that be
tblFaceToFaceReason.FaceToFaceReasonID <<<<<this
A dialog form is just that, a form that "carries on a dialog with the user" in the form of prompts that require responses from the user.
In regards to your query, you did not speifically state what happens when the code runs, And when you say it runs correctly with manual input.....are you getting prompted to enter something? What happens exactly?
This portion of your select list in your SQL statement looks incorrect:
tblFaceToFaceReason.FaceToFaceReason <<<<<should that be
tblFaceToFaceReason.FaceToFaceReasonID <<<<<this
Thanks for reading thru this, I know it looks conflomerated.
When I just open the query, it asks for both dates and the initials, even though I have the form open, with the info in the cbo and txt boxes. Again I havee numerous applications and places where I have parameter input, from forms and I have no issues, but for some reason, it is ignoring this form.
I of course have triple checked the names of the cbo and txt boxes, names of the query, names of the forms, and yet it is not working.
I appreciated you looking at it, I know without the entire app section it would be tough to figure out. I will work more and rephrase my question if I don't figure it out. Thank you so much. Ken
Thanks for reading thru this, I know it looks conflomerated.
When I just open the query, it asks for both dates and the initials, even though I have the form open, with the info in the cbo and txt boxes. Again I havee numerous applications and places where I have parameter input, from forms and I have no issues, but for some reason, it is ignoring this form.
I of course have triple checked the names of the cbo and txt boxes, names of the query, names of the forms, and yet it is not working.
I appreciated you looking at it, I know without the entire app section it would be tough to figure out. I will work more and rephrase my question if I don't figure it out. Thank you so much. Ken
There is one thing you can do.....declare your parameters. To do that, place your query in design view, then go to the command menu and select query>parameters, then supply the name and data type of your parameters. Sometimes Access needs this info because it can't or won't pick a data type for your parameters.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Google Mike |
last post by:
After a lot of thought and research, and playing with FreeTDS and
InlineTDS, as well as various ODBC connections, I have determined that
the fastest and cheapest way to get up and going with PHP on...
|
by: MBS |
last post by:
Yeah, read the previous posts...I did that. None answer my question.
I just installed PHP 5.0.4, Apache 2.0.54, and MySQL 4.1.13 a few days ago
on WinXP SP2. My goal is to learn to use these...
|
by: Richard Hollenbeck |
last post by:
For example, one college course has only 24 students in it, but the
following code says there are zero As, 20 Bs, 16 Cs, 4 Ds, and 8 Fs. When
it prints it then says 0 As, 40 Bs, 32 Cs, 8 Ds, and...
|
by: Patrick |
last post by:
I have an ASP.NET application that connects to a SQL Server database.
The SQL Server resides on a seperate development server from the IIS5.1 on
Windows XP SP2 on development PCs which host the...
|
by: tshad |
last post by:
I can connect to my to my database in Sql Query (using "web" and "SA"), but
I can't get it to work in ADO.NET. I tried it from Dreamweaver as well as
from an ASP.NET page with this string:
...
|
by: Joe |
last post by:
I'm connecting to an Oracle database and running a query which returns
data. The query can be fairly long - 2-3 minutes. I have a label set
up on the form which is invisible to begin with. I...
|
by: olafbrungot |
last post by:
I get the following error message when trying to connect to a host
database (OBCD connection) with "MS Query".
SQL0471N Invocation of routine "SYSIBM .SQLTABLES " failed due to
reason...
|
by: jonniethecodeprince |
last post by:
Greetings all.
I have a problem with PERL and SQL Server.
I need to upload a database query to a web page using PERL and SQL Server. I have tried to do this myself but nothing displays on the...
|
by: BigZero |
last post by:
hello i m new to php
i m working on project that has interface with simple html and php i m
thinking to use
i got some problem with the connecting to DB here is the code for
connecting db
...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |