473,769 Members | 6,187 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Another run-time error 3061 issue

I noticed several postings about issues related to "run-time error
3061", and I observed that the solutions to these issues appear to
involve correcting something within the SQL code. I'm encountering
the "run-time error 3061" issue, but I'm not sure how to go about
correcting the SQL. My hunch is that I have not properly constructed
things to identify a date field, but I don't know how to correct this
issue. In addition to not understanding how to correct the issue, I
do not understand why the query works when it is manually invoked, but
it fails to work when it is invoked within VBA code...seems as though
it would never work if I had incorrectly constructed the query.

My questions are:
1) what changes can I make to the query to avoid this error?
2) why does the query work when invoked from the query tab, but not
work when invoked within VBA code?

The stuff below provides more details.

- Running Access 2000
- created a 2-field query qryFDateInPast
- query relies on the contents of a field from a form
- when the form is open, and the field populated, am able to run the
query from the query tab within Access
- when the form is open and the field populated, receive the '3061'
error when running the VBA code below
- if I modify the query so that the second field is a non-date field
from tblDocumentSetu p, then I do not get the error...this is what
leads me to believe that I'm not formatting things correctly to
identify a date field

Within the query, the second field is defined as:
FDateInPast: IIf([FromDate]<[Forms]![frmSwitchboardA dmin]![txtMonthEnding],"Y","N")

The SQL view of the query is:
SELECT tblDocumentSetu p.ID,
IIf([FromDate]<[Forms]![frmSwitchboardA dmin]![txtMonthEnding],"Y","N")
AS FDateInPast
FROM tblDocumentSetu p;

The field FromDate in tblDocumentSetu p is defined as a Date/Time
field.

The field [frmSwitchboardA dmin]!txtMonhtEnding is a text box with
format of short date. I have been filling in this text box field with
the value 05/16/2004.

VBA code:
Dim db As Database
Dim rstZZZ As Recordset
Set db = CurrentDb()
Set rstZZZ = db.OpenRecordse t("qryFDateInPa st")

I get the same result if I try:

Dim db As Database
Dim quoteChar as String
quoteChar = """"
Dim strSQL as String
Dim rstZZZ As Recordset
Set db = CurrentDb()
strSQL = ""
strSQL = strSQL & "SELECT "
strSQL = strSQL & "tblDocumentSet up.ID, "
strSQL = strSQL & "IIf([FromDate]<[Forms]![frmSwitchboardA dmin]!"
strSQL = strSQL & "[txtMonthEnding],
strSQL = strSQL & quoteChar & "Y" & quoteChar & ","
strSQL = strSQL & quoteChar & "N" & quoteChar & ") AS FDateInPast "
strSQL = strSQL & "FROM tblDocumentSetu p"
Set rstZZZ = db.OpenRecordse t(strSQL)
Nov 12 '05 #1
0 3314

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

Similar topics

0
1826
by: Howard Rothenburg | last post by:
Here is an example of running a different ASP page from a current web page, using Javascript. function window_onunload() { var objSrvHTTP; var objDoc; var URL = "http://" + window.location.host + "/ASPPageToCall.asp; objSrvHTTP = new ActiveXObject("MSXML2.XMLHttp"); objDoc = new ActiveXObject("MSXML2.DOMDocument"); objSrvHTTP.open ("POST", URL, true);
1
3470
by: Khue Pham | last post by:
Does anyone knows how to copy database from one server to another. By copying I mean literally everything, not just the database. I know we can dump the database from one server then reload it to another one. However, I have a specific need for this and here is my problem: I have my development server as of RedHat 9.0 and I install the combination of LAMPS (Linux+Apache+MySQL+PHP+SSL). I configure it works perfectly on my development...
3
1893
by: Larry R Harrison Jr | last post by:
I designed this webpage: http://www.dbases.net/photography_pages/new_style_frames_index.html It has horizontal hover/pop-down menus; it works fine on the given machine run off the hard drive, but NOT off the Internet. However, on another machine in my house, it runs fine on the Internet, period--no problems. One of those machines it runs flawlessly on is the computer I designed it on; it also ran fine on a 3rd machine which is was NOT
4
3394
by: keepyourstupidspam | last post by:
Hello, I have a class X with a member function setConfigValues(). I want to access this member function in another class Y. Y is not inherited from X. A member function of class X called run() this instanciates the class Y. Class X { run();
5
1985
by: nephish | last post by:
hey there all, i have been looking for a way to run a php command line script from my python script. here is what i want to do: if x = 4: execute php4 testin.php else: execute php4 testout.php
0
1256
by: vulcaned | last post by:
Hi All, In Access97 I have a database(MasterControl), it has a form(MainMenu) with four buttons on it. On the click event of each button on the MainMenu form I want it to open another Access97 db and run several queries in it then close that another db. ex: button1 - open db -> Cash, run 3 queries in it, then close it. button2 - open db -> Credits, run four queries in it, close it. etc.....
10
14422
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another user to gain the required rights for execution (the external process needs to create a mailbox in Exchange, so it needs to be run as an Exchange Full Administrator-powered user). For the moment, I have tries using the Start() static method of the...
1
38977
by: Galaxia | last post by:
Hi, I am using C# of VS .Net 2003. I want to call another executable file (.exe) in my program. How can I do it? Thanks. -- "Forward Galaxia"
2
2202
by: Selen | last post by:
I have a aspx file in my computer.I want to run it another computer in network. I write http://computername/filename but it doesnt work.Why can it be ? How can I solve the problem Thanks
8
2048
by: MSDN Account | last post by:
I have looked at the documentation for 'Microsoft.Win32.Registry' and 'System.Security.Permissions.RegistryPermission' but am still stuck, hoping some can give me a nudge in the right direction. I would like to be able to modify the GPO Policy keys under HKCU for the logged user from an application. Because they are read only to the user can I prompt for an ID and PW (say a support tech) that can be used to access the keys with...
0
9589
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
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
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
9863
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
8872
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...
1
7409
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
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
5299
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...
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.