473,320 Members | 1,810 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,320 software developers and data experts.

QBF seemingly not connecting with query

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

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT tblInterviewRecord.FaceToFaceReasonID, tblInterviewRecord.InterviewtypeID, tblInterviewRecord.ContactDate, tblEmployees.Initials, tblInterviewRecord.ServiceTypeID, tblFaceToFaceReason.FaceToFaceReason
  3. FROM tblEmployees INNER JOIN (tblInterviewRecord INNER JOIN tblFaceToFaceReason ON tblInterviewRecord.FaceToFaceReasonID = tblFaceToFaceReason.FaceToFaceReasonID) ON tblEmployees.EmployeeID = tblInterviewRecord.EnteredBy
  4. 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]));
  5.  
And the code of the button to run the Query is this:


Expand|Select|Wrap|Line Numbers
  1.  Private Sub cmdRunQuery_Click() 
  2. On Error GoTo Err_cmdRunQuery_Click
  3.  
  4. Dim stDocName As String
  5. stDocName = "qryProductivity2Query"
  6.  
  7. DoCmd.OpenQuery stDocName
  8.  
  9. Exit_cmdRunQuery_Click:
  10. Exit Sub
  11.  
  12. Err_cmdRunQuery_Click:
  13. MsgBox Err.Description
  14. Resume Exit_cmdRunQuery_Click
  15.  
  16. End Sub
  17.  
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
Dec 7 '07 #1
3 1565
puppydogbuddy
1,923 Expert 1GB
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
Dec 7 '07 #2
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
Dec 9 '07 #3
puppydogbuddy
1,923 Expert 1GB
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.
Dec 9 '07 #4

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

Similar topics

0
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...
6
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...
15
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...
11
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...
2
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: ...
3
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...
3
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...
4
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...
3
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 ...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
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...
0
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...
1
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
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...

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.