473,657 Members | 2,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why does my run query command button not work?

1 New Member
I am trying to run a query from a form using a "run query" coomand button. The query fails to run, though it does open. The run query button works from the the design view of the query, but not from the linked form. How can I get the button to run the query?
Dec 16 '19 #1
2 1234
twinnyfo
3,653 Recognized Expert Moderator Specialist
sanguma97,

Welcome to Bytes!

Unfortunately you will have to provide us a bit more information.

Please provide the VBA code you are using and any additional information about the query that might be helpful. Also, if you are getting any error messages, this would also be helpful.

Thank you!
Dec 16 '19 #2
cactusdata
214 Recognized Expert New Member
"Run query" is for action queries.
It sounds like you try to open a select query. So, use
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenQuery
for that.
Dec 17 '19 #3

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

Similar topics

13
4749
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is like this: %@ Language=VBScript %> <!--#include file="includes/openconnection.asp"-->
2
2240
by: gbb0330 | last post by:
hi all first i would like to thank PC Datasheet, i got so far because of him/her i need some help again i have this command button the on-click event procedure is
2
5613
by: Darren | last post by:
Hi, I have a command button which has a macro running in it. The macro on the click event, runs to ensure that certain values in a form are valid, (e.g. the textboxes are not null) and after the macro runs, an update query would run... the problem is that how can i ensure that the update query would only
4
4793
by: John Smith | last post by:
I have a continuous form. there is a command button with the following code for the OnClick event: DoCmd.OpenForm "frmPlants", , , "PlantsID =" & Me!PlantsID I click the button and frmPlants opens up with the record that corresponds to the one on the cont. form. I put that same code for the OnClick of an image control (i.e. the user clicks a little icon to open the form instead of a button) and frmPlants
3
3503
by: chris | last post by:
I have a form det-up as a continous form. In the Header of the form I have a command button called "Approve". What I'm looking to do is when the user clicks the command button all of the records in the query that the form is populated with get a check box checked off. Can someone tell me what that code is? Thank you in advance. Regards,
15
2005
by: mforema | last post by:
Hey Everybody, I have code for a command button. The button is supposed to open a query with a general criteria of: Forms!!. The field of the query should match the in the Form. If a record does not exist in the query for the specified control name, I want a message box to display stating so. My code is below: If ( ) Then ' If record exists, then open the query below. DoCmd.OpenQuery "2 - Total Reflux Tests Query", acViewNormal,...
7
6516
by: pushrodengine via AccessMonster.com | last post by:
I have a command button “AddIncident”. I would like to make it so that it will not add the record to the database if textbox “Type” is empty. I also would like to add a message that will prompt the user with the message “You must enter incident Type” when textbox “Type” is empty and the “AddIncident” button is pressed. Thank You -- Message posted via AccessMonster.com
2
1737
by: zillou32 | last post by:
Hi guy, my question is as follows, am currently working on an excel sheet and need to add a vb command button. the action of this button is to to sent the sheet by mail (outlook). the command button should do the same action as if someone click on file then sent as attachement. well if someone have the coding for that, please let me know. thanks & regard,
1
1519
by: Barne6ae | last post by:
Currently have a Multiple Field (from 4 fields or is Null, txtFiscalYear, cboUnit, cboItem, cboStore) search form that user can use to query and pull data. When user click on a query button the results show up on a sub-form. Would like to have a Clear Button where user can clear the result and then input different data to re-query on. Query work, however; when I hit the Clear button the query button does not return any results and does not...
0
8392
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8305
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
8823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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
7321
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 projectplanning, coding, testing, and deploymentwithout 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...
0
5632
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.