How to set shortcut key to open query in ms access. can some body explain clearly - ms-access-2007

How to set shortcut key to open query in ms access. can some body explain clearly. how to set shortcut key to already designed qureiess

You can attach a command button to open the query, then in the Command button caption add & and the short cut key you want to use to open the query.
e.g if a command button's caption is Run Query , you can change it to
&NRun Query ,tis will ensure that Alt and N keys will open the query.
Check the images i attached.

Related

Link a popup form with a master form

I have a continuous form (MasterForm) for data entry based on one table. Some records need additional data, which I want to enter in a separate popup form (which has another table behind). This popup form (SlaveForm) opens by means of a click event in the MasterForm which triggers the DoCmd.OpenForm (vba instruction).
How can I “force” the popup form (SlaveForm) to be “in line” with the last current record of the MasterForm, by VBA code, exactly as I can do in a form/subform format (but here access has explicit tools to do that)?
Edit: See uploaded example
https://gofile.io/?c=VvMfiv (I am using an external link, since I was not able to find how I can do that in stackOverflow)
In the example, let us supose that we want to add Wagner's Parsifal Opera. After entering the name Parsifal you choose "Have Characters". It will open the SlaveForm (characters), where you want to write "Parsifal" and "Amfortas". However, I am not able to configure the synchronization between the MasterForm and the SlaveForm.
Any suggestion?
After some more digging, I manage to solve the problem. The BeforeInsert event in the slave form is the key. See uploaded file: https://gofile.io/?c=UxRdM8
In the MasterForm there is a text box (which can be set to be invisible) with the primary key (txtIDWork). After the Slave Form has been loaded, and before inserting a new register in the SlaveForm/Table, the BeforeInsert event (of the SlaveForm) assures that the primary key of the MasterForm (of the current register) is set to the foreign key of the SlaveForm:
Private Sub Form_BeforeInsert(Cancel As Integer)
Me.txtWorkNumber = Forms.frmMaster.txtIDWork
End Sub
where txtWorkNumber is the text box where the foreign key is written (which can be set to be invisible).
have you tried using a subform that is invisible until you need it, then making it visible when you want to enter data, then hide it again once you have filled it in?

Ms Access and SQL: how to identify where error occurs

I have a form in MS Access where a lot of queries are running to calculate all kinds of numbers using user input and using other queries ouput. All of a sudden I get the error below:
Error text is:
The record source ' ' specified on this form or report does not exist.
The name of the recordsource may misspelled, the recordsource was deleted or renamed, or the recordsource exists in a different database.
In the Form or Report's design view or layout view, display the property sheet by clicking the properties button, and then set the recordsource property to an existing table or query.
I don't remember exactly what I added/removed to have caused this and I can't find where the error occurs. How can I, I guess, debug my Access Form while it's running queries?
I don't see your image as it is blocked at work.
The only one way to debug the application when errors occurs is to break the execution using the keyboard combination :
CTRL + Pause/Break
Do it when the error message appears
This obviously doesnt work if the application is compiled in a mde/accde
When the CTRL-Break doesnt work, you have to add a break point in your code.
Bring the VBA window using
ALT + F11
Open the code of your form, go in the procedure that triggers the queries, select a line of code at the beginning and add a breakpoint using F9
Then run the form, it will stop the execution on the breakpoint and show you the VBA window, continue to execute the code step-by-step using F8 until the error occurs
When ever you change the name of a table in ms access for that has drop down list, go to the design view --> property Sheet--> Row Source and change the names to the corresponding names for the drop down selection for combo selection

Use command button to open selected record on a form without filtering?

I have a continuous form which displays a small amount of data from each record in my table ProjectT (i.e. project name, status) and a command button in the footer which I would like to open the selected record in its expanded single form (where all of the relevant info is displayed).
At first I set this button up using Access's wizard, but realized that Access opens a selected record by filtering the data on the form. The problem with this is that once the expanded form is opened, I want a user to be able to move to other records without having to select to unfilter the results. If I change the button on my continuous form to simply open the expanded single form, is there code I can run to make the form open to the selected record without putting a filter on?
Initially I thought to set the expanded form's (named ProjectF) default value to Forms!ProjectListF!ProjectID (where ProjectListF is the continuous form and ProjectID is the autonumber primary key for ProjectT), but this was not successful, I think because there is more than one ProjectID displayed on ProjectListF.
Another thing to consider is that I have another button on my Main Menu form which opens the ProjectF form in data entry mode to prevent the user inadvertently changing/deleting an existing record when they are trying to add a new one; I have no idea if this might be important when trying to find a solution to my issue.
I'm open to any suggestion--I have an okay handle on SQL, and have delved into a little VBA but am completely self taught. Any ideas? Thanks!
You can open the detailed form with this command:
DoCmd.OpenForm "ProjectF", , , "[ProjectID] = " & Me!ProjectID.Value & ""

SAS EG dynamic text field

is there a text field control in SAS EG ?
how can i set the selected prompt value ( parameter) into a text field(header is ok too) that will show in the report?
sorry , im new in SAS , so those term im using might not be the correct one.
It is possible to add prompted value to a header.
First go to the Prompt Manager under View menu
Click Add to create a new prompt
Give your prompt a name eg. HeaderText and a display text like Text to display in report header. In the second tab, make sure it's of the type text.
Open the properties (NOT modify, but bottom option of the right click) of the report you want your text to be displayed in.
Go to the prompts screen and add the prompt you just created and click OK.
Now open the modify window of the report.
Go to the titles screen, disable Default Text and enter &HeaderText. in the text field.
Run your flow. It will prompt for a text and that text will be printed in the header.

stored proc from excel with parameters

If I create a stored proc in sql that has a parameter, can I run that from Excel?
Without using VBA you can use this method. This assumes your stored procedure returns a result set. It also does not make the parameter pulled from a workbook. I think you'd have to use VBA to do that.
Under the 'Connections' section click 'Connections'
Click Add
Click 'Browse for More...'
Click 'New Source...'
Select 'Microsoft SQL Server'
Click Next
Type in the login credentials and click ok.
Select your database
Uncheck 'Connect to a specific table'
Click Finish.
When asked to select a table just click ok.
This should bring you back to the Workbook Connections screen with your new connection added.
Select it and click 'Properties'
Go to the 'Definition' tab.
Set the Command Type to SQL
set the Command text to the SQL you want to run (i.e. "exec spStoredProc 'value'")
Set a new name for your connection
Click ok.
if told that you are severing a connection just agree that, that is okay.
Click 'Close' on your 'Workbook Connections'
Click 'Existing Connections' under the 'Get External Data' section
Select your connection you just made under the 'Connections in this Workbook' section.
Click Open
Set your Import Data options if you want or just click ok
You should now see the result set from the SQL Query in your excel worksheet.
This data can be refreshed from the data that is in the database by going to the data tab and clicking 'Refresh All'
Yes
A standard ADO call from VBA. Or use the Tools..Data thing.
Sure, you can use VBA.
Or you can do it like this: http://blogs.msdn.com/b/excel/archive/2010/06/08/running-a-sql-stored-procedure-from-excel-no-vba.aspx
Here's another nice article on it.
http://www.itjungle.com/mgo/mgo102203-story01.html
I have been working to find a solution to this for a while now and got the best results from following the steps in this article.
http://codebyjoshua.blogspot.com/2012/01/get-data-from-sql-server-stored.html