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

opening a query as a subform

2
i've placed a query as a subform and an action button to run the said query. whenever i click the ' run query' button, it opens another tab and shows the query. i want the query to get updated in the subform itself. pl help
Jun 23 '15 #1
3 3120
jforbes
1,107 Expert 1GB
The Wizard only creates a button to show you a query. It's not context sensitive and doesn't really know what you are doing or attempting to do.

You'll want to edit the button and replace the code that looks like this:
Expand|Select|Wrap|Line Numbers
  1.     Dim stDocName As String
  2.  
  3.     stDocName = "TheQueryYouWantToRefresh"
  4.     DoCmd.OpenQuery stDocName, acNormal, acEdit
With something like this:
Expand|Select|Wrap|Line Numbers
  1.     Me.TheNameOfTheSubForm.Requery
Jun 23 '15 #2
zmbd
5,501 Expert Mod 4TB
shrysh:
which version of Access are you using?
The control wizards starting in ACC2010 started using the Macro script language by design. To use J's code you will have to convert the control over to VBA.
Jun 23 '15 #3
shrysh
2
thanks for your replies,

I'm using access 13, i found a way of doing it using inbuilt macros.
1. open form in design mode and select a button.
2. choose create macro and asign it the property 'requery' and leave the rest field blank. not to be confused with the 'refresh' option available.
3. open in form view and clicking on the button requeries all the open queries thus refreshing the subform already open.
Jun 24 '15 #4

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

Similar topics

1
by: Stephen D Cook | last post by:
I have a form with txtSN text box, btnShow button, and a subform. The form is bound to a Table. The button is bound to a lookup query. The query is bound to the text box. I want to be able to...
0
by: HJ | last post by:
In Access 2000 (ServiceRelease 1) I have a subform in Datasheet view. On one field I have applied conditional formatting: the back color is set to red, based on some condition. The problem is...
1
by: HJ | last post by:
In Access 2000 (ServiceRelease 1) I have a subform in Datasheet view. On one field I have applied conditional formatting: the back color is set to red, based on some condition. The problem is...
5
by: reubmeg | last post by:
I have a client who is having problems opening up queries in design mode. When the datafile that the query is looking at is in use by someone else, it takes up to a couple of minutes to open. I am...
7
by: KC-Mass | last post by:
I have a module that walks down a file of unique claim numbers. Db is Current db. For each claim number I want it to retrieve, to a recordset all the transactions related to that claim. The...
21
jinalpatel
by: jinalpatel | last post by:
I have three option buttons (1 option group): construction projects, non construction projects and aquisition projects. I have created a form with more than 35 data entry fields for each of this...
2
by: dbdb | last post by:
Hai, need a help please. i have a form to view the query subform 1. form name : form1 2. query subform name : subform1 3. textbox name : txtclass1 4. command button name : cmd1 i want to...
13
by: darnnnel | last post by:
Hi this is what i have so far, but it doesnt seem to be working right. I am getting an error here: qryReferral.Status = 'Open' Private Sub cmdFltrOpen_Click() Dim sSQL As String ...
3
by: ThingTwo | last post by:
I'm a relative newbie to Access, working in 2003 and trying to build a very simple client database for my company. Here's the basic set-up I have so far: -Clients Table contains all the relevant...
5
by: HiGu | last post by:
I need to filter a form using the selection made by user from a dropdown.I have used the following code which throws an error: invalid argument Private Sub cboLocate_AfterUpdate() Dim rst As...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.