Pass Variable To Form And Decide Which Query

Aug 15, 2006

Is it possible to pass a variable to a form when a checkbox is clicked?
I have 8 tabs, each of which has a checkbox.
When a checkbox is clicked, I would like it to display 1 form but that form should display different data each time by either running a SQL query with specific variables passed to it or by running a different SQL query.

?

View Replies


ADVERTISEMENT

Pass Variable In Query Criteria

Mar 3, 2008

Is there any way to pass a variable from one criteria on a query to five other criterias in the same query.

I am using this code to select which person the query is running on

Like "*" & [Enter Part of The Landman Name or Enter For All Records] & "*"

I have five areas in this query where I would need to add the name, I just want to do it once?

Thanks.

Fen how

View 14 Replies View Related

Modules & VBA :: Open One Database Form Another And Pass Variable To It

Feb 19, 2014

I have a button on my main db, that opens a second db using hte following code:

----------------------
'Dealing with external objects, use inline error trapping
On Error Resume Next
Dim appAccess As Object

Dim db As Database
Dim strAppPathName As String
Dim strAppName As String
Dim strTimesheetPathName As String

[Code] ....

This code works great to open the other db, and handles wheter the other db is already open or not, but I cant seem to pass the variable to the other db using the startup switch /cmd.

I suspect if I used the shell method it would pass the cmd , but I havnt found any way to test if the db is already open with the shell method.

How can I pass a variable to the other db when opening it using VBA?

View 10 Replies View Related

I Am Trying To Run A Pass-through Query In Access With A Variable That A User Enters

Nov 29, 2007

I am trying to run a pass-through query in access with a variable that a user enters in a form. I can't seem to get this to work. Can somebody please help? The variable should be where the 121212 is in the code.

Code


1:FROM doc..eco_summary es
2:INNER JOIN
3:((((mart..DM_Map dmm LEFT JOIN mart..DM_PI dpi ON dmm.Acct_ID = dpi.Acct_ID)
4:INNER JOIN mart..DM_Note dmn ON dmm.Acct_ID = dmn.Acct_ID)
5:INNER JOIN mart..DM_ACCT dma ON dmn.Acct_ID = dma.Acct_ID)
6:LEFT JOIN mart..DM_RE dmr ON dmn.Acct_ID = dmr.Acct_ID) ON es.L_loannum = dmm.Acct_ID
7:INNER JOIN weis..eco_loan_origination elo ON es.L_num = elo.num
8:where es.L_num = 121212

View 1 Replies View Related

Queries :: Parameter In Query Decide By Click

Oct 23, 2013

how can run a query with paramtoeter of label, on which i click i want to run a query ,with parameter ,which decide by lebal, on which i click with in diffrent labels such as

i have 3 labels
1--A
2---B
3---C

when i click on label 1(A) query select record which belongs to (A) ,again when i click on label(B) this query show records which belongs to (B)

View 1 Replies View Related

How To Run SQL In VBA And Pass The Results To A Variable

Oct 31, 2013

I am trying to figure out if this line of code is usable, but I don't know: DoCmd.RunSQL ("SELECT Max([BSRangeTbl].[Date]) AS MAXofDate FROM [BSRangeTbl];")

View 2 Replies View Related

Modules & VBA :: Pass Variable To GOTO Statement

Jul 3, 2013

Is there a way to pass a variable to the GOTO statement?

View 14 Replies View Related

How Do I Pass A Parameter From A Form To A Query?

Sep 11, 2005

Hi

I am struggling with what seems like should be a straightforward task. Unexpectedly however it has become an infuriatingly difficult one (no doubt due to my complete novice status).

I have a very basic d/base (3 tables) that I have been searching using basic SQL queries. I want to create a simple 'search' form that produces the results of my various queries without the need to work in SQL. Enter one or more search criteria, hit ENTER, results presented in datasheet perhaps?

Thought this would have been easy but I've had no luck. Can you please explain how I can pass a parameter from a form to a query?

Many thanks

Stuck21

View 1 Replies View Related

Pass Dates From Form To Report To Query

Jan 29, 2008

I am trying to enter dates in a form that calls a report that invokes a query that uses the dates. It has been a less then satisfying experience. I am getting a Run-Time error 3122. Is it possible and I need to work on syntax or do I need to think of another way? BTW how do I lookup the Run-Time errors?
Thanks for helping an old guy learn new tricks.
Jim

View 5 Replies View Related

Pass A Set Of Current Records In A Form To A Query

Feb 15, 2007

I have a query set up. I need to pass a set of current records ( as I select them in a drop-down menu) in a form to the query as parameters. How would I do it with or without VB? Thanks !

EDIT: Forgot to mention that all combo boxes are bound so they are not customized dialog-boxes which are unbound

View 3 Replies View Related

Pass Multiple Values On Form To Query

Jun 28, 2005

Hi there. What I'm attempting to do is pass multiple values from a multiple selection list box as criteria for an Append Query. Is there any way to do this? The DB keeps track of Real Estate boards and the forms that they use, I would like to be able to select all the boards in a given state/province, but have the ability to deselect some within that province if I don't need them in the query (this is the criteria i'm trying to pass). I don't need to use a list box, any control that would allow me to pass multiple values would be great. Anyone able to help? Thanks very much.

View 1 Replies View Related

Queries :: Pass A Formula Form A Query To Excel

Apr 5, 2013

Access 2003
Excel 2003

I have a routine that exports the results of a query to an Excel file. Is it possible to input the formula into the query so that the Excel values calculate?

This is the formula I am trying to pass to the "AZ" column of the Data tab

Code:
MyCalc::"IF(T2="","0",TODAY()-T2)"

View 1 Replies View Related

Queries :: Pass TempVar To Query That Is Selected From Previously Opened Form

May 23, 2013

I'm trying to create a query that supplies a form with data. I want to pass a TempVar to the query that is selected a from previously opened form.The TempVar is setting correctly and I can see if this if I place a textbox (NewCID) on the form showing the TempVar. The problem I have is displaying on the records according to that TempVar. If I set the query manually, i.e. "|Test|" then records are displayed but if I use the TempVar, which also displays |Test| then no records are brought back.

think it's something do with the vertical bar and that fact the field I'm searching on is a memo field, both of which I've no control over. I also have to use the Like statement because of this.Here's the query that works...

SELECT *
FROM dbo_ASSETS
WHERE ASSET_CID Like "|Test|"

and the one that I want to use, that doesn't...

SELECT *
FROM dbo_ASSETS
WHERE ASSET_CID Like [TempVars]![tmpvarCID]

I've even tried referring to the textbox instead of the TempVar, i.e.

SELECT *
FROM dbo_ASSETS
WHERE ASSET_CID Like [Forms]![AssetsCID]![NewCID]

but that doesn't work either.

View 2 Replies View Related

Using Option Buttons To Decide Corresponding Search Mode

Sep 12, 2005

dear experts,

i am a student and i have a project to complete in 2days. i have managed to crawl through access and come up with forms and a functional query set. i need to create a search function for names and addresses. i manged to do a fisrt name search. i need to make an option for users to choose either first or last name and then search for the other details.

here is my situation, i need help connecting a radio button to a search form. allow me to illustrate my form.

************************************************** *******

first name : _________ (combo box) last name : _________ (combo box)

[0] (option button) [0] (option button)


SEARCH ( command button)
************************************************** ********

as of now, the first name combo is connected to the search button via a macro which launches the query with a value from the combo box. how do i make the user choose either option "first/last" and then make the search button search appropriately. please help me. i know this is elementary. i've spent too much time looking for a solution on my own. my time is running out to complete the project. and i've yet to create switch boards and all those other things. please! thanx all.

View 2 Replies View Related

Form Variable Passed To Query

May 7, 2007

Not sure if I am asking the right question, but....

I would like to pass a string variable to a query but it does not seem to work.

In the query, my criteria for the date field is (and works):

>=[forms]![frmDisposition]![FromDate] And <=[forms]![frmDisposition]![ToDate]

But, this is not working for the ID field criteria:

[forms]![frmDisposition]![ID]

In the forms code, I have a string based on the result of 3 check box. I tried using an unbound (ID) control to display the string so I know that the value of the string is correct. EX: "FW" Or "MA" Or "PD"

Is it possible to pass the value of the string to the query or do I need to try and pass the value of the unbound control to the query?

View 6 Replies View Related

Forms :: Using A Variable From A Form To A Query As A Criterion?

Feb 23, 2015

I want to use a variable from a form to a query as a criterion. but how?

View 1 Replies View Related

Procedure Works Great First Pass, But Not The Second Pass

Jul 15, 2005

Good afternoon, I have a form with a subform and in the first txtbox of the subform in the GotFocus event I have a little procedure which checks the txtboxs on the parent to make sure that there is data in all four of the txtboxes. This works great the first time and it pops up a msgbox and it even setsfocus on the txtbox with no data in it, but if I tab into the subform a second time and there still is no data in one of the txtboxs on the parent form, nothing happens, no message and no setting focus on the txtbox with no data in it. Does anyone know of a way to get this procedure to re-set everytime a user tries to enter the subform? Thank you in advance to anyone offering and ideas and suggestions.

View 8 Replies View Related

General :: Modal Form - Open Concrete Form And Pass Value To Control

Jun 21, 2013

I have modal form - frmZlecenia

I would like to copy one control, then close this form, open concrete form and pass value to control.

My code is

Private Sub Menu_Click()
DoCmd.OpenForm "frmZleceniaMarzenaNawigacjaPD"
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie = Me.Imie
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie.SetFocus
DoCmd.Close acForm, Me.name
End Sub

The problem is, still opens the previous form, not form "frmZlecenia"

e.g If I open form x then from this form I open my modal form "frmZlecenia" and then I will click "menu" button - now form "x" is open :/, but should be "frmZleceniaMarzenaNawigacjaPD"

There is some way to open concrete form from modal form?

View 1 Replies View Related

How To Pass A Value From One Form To Another

Nov 26, 2013

So I have 2 forms, an Edit Lot Form, and an Add Run Form. Each lot will contain several runs. What I want to do is be able to add a run associated with the specific lot by pressing a button "Add Run" in the lower right corner of the edit lot form (see attached images). So the information for the lot will carry over to the run form and autofill the fields pertaining to the Lot in that form.

View 2 Replies View Related

Pass-Through Query Help

Jul 13, 2007

I'm trying to create a PTQ and just cant seem to find the source table.

The name of the source table is PRM1_ORG_MTRX3_N

If I write my query like this, I get an error code that states username.PRM1_ORG_MTRX3_N is an undefined name. It adds my userid to the beginning of the table name.

SELECT
T128.AS_OF_DATE,
T128.LEVEL8,
T128.LEVEL8_ORG_NAME,
T128.LEVEL9,
T128.LEVEL9_ORG_NAME

FROM
PRM1_ORG_MTRX3_N as T128

WHERE
T128.AS_OF_DATE like '1/1/2007'

Then I rewrote the query like this, and I got and error code that said PRM1.ORG_MTRX3_N is an undefined name. Does anyone know what else I can try here to get this query going? Thanks


SELECT
T128.AS_OF_DATE,
T128.LEVEL8,
T128.LEVEL8_ORG_NAME,
T128.LEVEL9,
T128.LEVEL9_ORG_NAME

FROM
PRM1.ORG_MTRX3_N as T128

WHERE
T128.AS_OF_DATE like '1/1/2007'

View 2 Replies View Related

Pass Through Query

Jun 30, 2006

Can you do a pass through Query to a pivot table when your query has parameters? I'm reading like you can't, but nothing has been said concretely yet. When I do it, it gives me an error "Trouble Obtaining Data" when I try and set the layout.

View 1 Replies View Related

SQL Pass Through Form Variables

Feb 3, 2008

I know this is probably obvious but how do I pass through form variables to sql server I currently have:

exec QStudent @_param_cmbYear="0708", @_param_SelID="S", @_param_SelForename="d", @_param_SelSurname="S"

this executes correctly SelID being a student ID or partial ID also allowing for surname forename partial search. I thought it would just be:

exec QStudent @_param_cmbYear=[Forms]![Attendance and Lateness Main]![cmbYear], @_param_SelID="S", @_param_SelForename="d", @_param_SelSurname="S"


to switch acad year to a form variable and repeat for the others but it errors on trying to save the pass through. Thanks for the help.

View 1 Replies View Related

Pass Values From One Form To Another

Jan 21, 2015

I have a database that I am creating to enter risks and controls in for business auditing. I am stuck with a problem related to passing a value from one form to another. The general idea behind the database is this: A business enters its risks into a risk form and later enters its controls in the controls form. These are separate forms because the risk and controls may be entered at different times by different auditors. An example of what this looks like is this:

Risk Real estate owned by the company may be overvalued on the companys balance sheet.

Control Once every two years, the company obtains an independent appraisal of the propertys value.

A risk may have more than one control mapped (assigned) to it. A control may be assigned to more than one risk.Now that we know what the end result looks like, here is my problem.

Currently, I use a form to display the risk. This form has a subform on it which displays the control. I use a combo box on the subform to choose the controls ID reference number. When chosen, the control appears in the subform. This form then populates a join table which now contains the foreign key identifiers of both the risk and the control or controls. The problem is that the controls are wordy and stored in memo fields, so the user has to choose the controls identifier in the combo box, which is usually not know to the user. So, I have a button on the form the user can select and a report of all controls pops up so the user can scroll through and find the desired control and get its reference ID. They then close the pop up report and choose the reference ID in the combo box.

What I would like to do is to have the pop-up report appear as a form and each control had a checkbox next to it. Then the user could just check the box for the control they wanted. No more selecting reference IDs from the combo box.

View 1 Replies View Related

How To Pass Parameter To Query?

Dec 6, 2007

Hi

I have created a simple query that is used as the record source of one of my forms. I want to pass the query a different criterion each time the form is opened.

Any suggestion/example on who to do that will be very much appreciated.

Thanks,
B

View 4 Replies View Related

Pass-Through Query Question

Jun 6, 2006

I have an Access front-end connected to Oracle tables. When the user opens up the main form to add a new entry, I need to be able to pull the next sequential record number. However, I can't get this to happen, without filling out the entire record, saving, and then it will committ the number.

Can this be done with a pass-through query to the Oracle table, find the next sequential number, and then add it to my record id (ie, 06-1050, with 06 being the year and 1050 the next sequential number). I do have two fields in the Oracle table TXTYear and LNGNumber. This concatenated field is related to three additional tables that have more information. Each of these tables need to cascade a new record.

Confused? me too. any help would be appreciated.

View 1 Replies View Related

Open Form And Pass Data

Apr 19, 2006

Hi All,

I should know how to do this but my brain has gone blank.

I have a form "frmMainClient" which has a field "account_no".

On the main form "frmMainClient" I have a command button which opens a pop up form ""frmJobNew" where I can enter a new job record. The "frmJobNew" form has a field "account_no".

I am trying to auto fill the "account_no" field with the data from the "frmMainClient" - "account_no" field and store the passed data when the record is saved.

I can pass the data using "=forms![frmMainClient]![account_no] in the "account_no" field on the "frmJobNew" but when I save the record the data is not saved.

Can anyone offer help, please

Many thanks.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved