Using SQL Query In Access's Form

Nov 15, 2006

I have a feeling that this is a silly question. But pls excuse me as i am a newbie and i have been beating abt this issue for 2 days and i have not been to solve it.

I made a form with 1 combo box, 1 buttom and a Grid DTC.

Now, for example. Taking the scenario of a car showroom.
By choosing the name of a brand or Company(like Honda) in the combo box and clicking on the button. I want to display every model(like Civic, Accord) that is available from that brand.

I wrote the query to do it in Queries part of access. It is working fine. But i am unable to write that query in the VB window that pops up when i go to the Events in the property of button.

Pls guide me
Thanks

View Replies


ADVERTISEMENT

Help A Beginner With An Access Query/form

Apr 18, 2007

Hi

We are a small Library just opened in our community, and the first one in our local area.

We are putting together an access query that will help aleviate the problems when our main library systems go down.

The database is a library records db. I want the query to ask the user for an author and a site and then to list all the records that match that query. Ideally i would like the user to be able to select a number of sites (from a possible 5), perhpas from a drop down type menu or checkboxes, type in the Author and then click on a button to perform the query.

Any help would be gratly appreciated - we are all beginners with access here.

Do you need to see what I have done so far? if so I could upload it for you.

Kind Regards

View 2 Replies View Related

Help A Beginner With An Access Query/form

Apr 18, 2007

Hi

We are a small Library just opened in our community, and the first one in our local area.

We are putting together an access query that will help aleviate the problems when our main library systems go down.

The database is a library records db. I want the query to ask the user for an author and a site and then to list all the records that match that query. Ideally i would like the user to be able to select a number of sites (from a possible 5), perhpas from a drop down type menu or checkboxes, type in the Author and then click on a button to perform the query.

Any help would be gratly appreciated - we are all beginners with access here.

Do you need to see what I have done so far? if so I could upload it for you.

Kind Regards

View 3 Replies View Related

Access Query Property From Form?

Jun 9, 2005

I have a form that is to be used to browse through parts using various filters (like category, snippets of part number or description) to find particular components, and then draw information from those components onto the form to be used for other things.

Queries I seem to understand - I've made a query which I've embedded on the form which happily filters the parts using the combo-boxes and text boxes on the form.

What I can't figure out is how to access the information IN the query! There doesn't seem to be a "double-click" event, or a "highlighted row" property, that I can use to tell the query WHICH of the parts returned after filtering is the particular one Im interested in, to draw information from the row.

What I want is a command button that, once the desired part is selected, "sucks" the data out of the query into text boxes on the form.

I've tried something like -


Private Sub cmdSelect_Click()

Me.txtSelectedPartID = Me.qryPartFinder.PartID

End Sub

...but it tells me that the method or data member is not found. When I'm typing the code the auto-complete thingy happily finds "qryPartFinder" when I type "me", but none of the available properties in the list for qryPartFinder seem to be what I need.

How DO you access the data in a highlighted (and/or somehow selected) row?

TIA.

Col.

View 2 Replies View Related

From Form To Query - Access Newbie

Aug 24, 2005

Hi all. I am fairly new to access and am trying to do something that shouldn't be that hard. I have a simple form with one text box and a command button on it. I have the command button set to run an update query.

My problem is that when I enter data and press the button, I don't know how to get the entered data into the query?

I know this is simple to do, but since I am new to access, I can't figure it out. Does anyone have a simple example or step by step details that they can share with me?

Thanks

Chris

View 2 Replies View Related

Access 97 To 2003 Using Form Data In Query

Dec 12, 2005

I was just converted from 97 to 2003 this weekend. I have a query set up that links a field to a form to get the date entered in the form into the query. For example if I enter 12/31/04 on the form and run my query it is put in the field 12/31/04. But in 2003 it is just blank. The formula I used in 97 is

StartDate: [Forms]![Cash Flow]![Start Date]

Is there something new I should be using to get that to pull in?

View 1 Replies View Related

General :: Access Form To Populate Query?

May 3, 2013

basically i'll have one table, containing several fields. name/website/date.i want to create a form/s for users to use. 1 is to allow the user to create a new record. i've completed this ok

the second form is to allow users to open a form, enter/select data and run this.....and the output goes to a report.i've created the query ok.....however, when i create a form to "link" to the query open the form, it shows all my records in table i.e. i can move through the records (from bottom of form) and when i actually fill in the form it actually modifies the data in the table.

View 3 Replies View Related

Forms :: How To Get Form In MS Access To Query Multi-selections

Jan 11, 2014

I'm really new to Access and using Office 2007. Comfortable with SQL but have no idea about VBA. How do I get the form to query multi-selections? For example if you download the attachment here and refer to "Form1", let's say the user multiselects BK and McD's for Vendor, burger for Food, and Coke for Beverage. It should be spitting out 3 records but instead spat out an empty table. I tied my last query "query2" with "Form1" to make them work hand-in-hand which filters the master table "Fast Food". Would I need to tweak the syntax seen in the "Criteria:" cells of "query2" to make them read in multiselections?

View 3 Replies View Related

Queries :: Access 2010 Query Won't Recognize Criteria From Form Text Box

May 7, 2014

I've been writing queries in the following format for years in Access 2003, but having recently transistioned to Access 2010, I've found the following sql doesn't work.transform

sum(s.value)
SELECT
s.sn, s.ln, s.pn, s.id, s.lat, s.point, s.supply_type, s.used, s.real, s.code, c.name
FROM
supply_points s
, codes c
WHERE
s.code = c.code
and s.id is not null
and s.code = 1075
and s.month >=[forms]![main]![gppstart ]
group by
s.sn, s.ln, s.pn, s.id, s.lat, s.point, s.supply_type, s.used, s.real, s.code, c.name
pivot
s.month

In Access 2010, this query returns the following error message:the Microsoft Access database does not recognize '[forms]![main]![gppstart]' as a valid field name or expression

Is this a common phenomena in Access 2010?

View 3 Replies View Related

Queries :: MS Access 2010 - Put Month On A Form Based On Data In Query?

Mar 26, 2014

How do you put the Month on a form based on the data in a query?

View 1 Replies View Related

Queries :: Access 2013 Navigation Buttons - Criteria For Query Linked To Dropdown Box On Form

Apr 13, 2015

I'm working with a form in Access 2013 that uses the navigation buttons. I'm trying to have my criteria for a query link to a dropdown box on the form. I had no problems doing this in Access 2010 with normal forms, but I can't link the criteria, in the query to the Navigation buttons form box. I'm tried using

[Forms]![TheNavigationTab]![NavigationSubform].[Form]![Field]

And various forms of the above... but i still can't see to tell the query to find the critiera at this location...

View 1 Replies View Related

Using Access's User And Group Accounts Or Using A Login Form To Access Database?

Sep 9, 2005

Using Access's User and Group Accounts or Using a Login Form to access database?

I've been researching on how to make a database secure. How to create User and Group Accounts on access, I see the step by step instructions and tried it out myself.

I also saw some sites where they give an example of a Login Form and how to create one.

My question is do you need to create both. First create the users and groups to permit or deny access to certain forms and then have a login form?

But would that mean that they'd have to login twice? Once when the database opens because it activates the db security that was created and then login again in the login form that was created?

Also when the user logins in and clicks on the cmd button on the form which opens up another from, frmWorkLog, I have an Employee field. This field I want it to have the user's name entered automatically and "locked". So that info, employee name, is extracted from the user's login. So then the user can only see his or her records only and no one elses.

How would I go about creating that. Hope I made my explanation clear.

Thanks in advance.

View 3 Replies View Related

Remove Access Parameters Request For Simple Access Search Form

May 3, 2014

I have a simple access search form , that's based on a query that fill parameters from the form textboxes, when the access form loads its keeps prompting for parameters value which looks ugly .. I want to open the form, displaying all the records in the table and filter when i click search ..

I have a data entry entry form, that i want to generate success message after successful insert in database. I have done it in the button event if no error happens, still if i left all fields blank and clicked save, it displays the message ..

I need to change that to display please fill the textboxes then click save , and display success message when the row is actually inserted ..

Check the following attachment for sample.

View 14 Replies View Related

General :: Only Open MS Access Form Without Access Running In Background?

Aug 7, 2013

I have made a form on access which will be used by other employees within the company, however they have never used access before and they are wanting to access only just the form as I feel with Access and all the tools in the background will confuse them, plus I don't want them editing the data base its self.

Is there a way to only bring up the form, unless I obviously need to edit the date base.

I've done some research on Google and it seems I need to use:

SW_SHOWMINNOACTIVE

However I can not seem to find how I would use this or where?

and also if i did find a way to only bring up the form, how would I be able to switch it from that veiw to the veiw I edit in?

View 2 Replies View Related

Question: Opening Access Form Without Access Installed.

Mar 28, 2007

Hi,

I have a database (.mdb file) which includes a table, forms and VB code. I intend on putting it onto a CD and then opening the form on another computer which may not have Access. Is this possible? Can I convert the file or can I attach some type of reader to the disk?
I have seen some software for download on the internet which allows you to open the tables however the Form is the most important thing in this case (but I take it whatever I use, it will need to be able to view the VB, subforms and tables as well since the Form depends on them?).

...also can I install an auto-run to the file for when the disk is inserted? (this is not a major issue though).

Thanks.

View 5 Replies View Related

Converting Access To Access Project Query Problem

Sep 18, 2007

Hello All,

I am working on a project that was started in access, but needs to be moved into an Access project so that It can be integrated with other forms. When I did this I realized that my database queries needed to be changed from Access to SQL code. for example instead of representing a date as #DATE# it needed to be represented as 'DATE'.

However I have one issue that I am having issues with.

I have a query that determines a few collumns by running information through a vb function and returning the result.

The issue is I do not know how to convert this code from Access to SQL so that it will work.

The code is

SELECT Action_Indef([DUE],IIf(IsNull([WAIVER]),[DUE],[WAIVER]),[LOG_NO]) AS [Action], TESTSTAT.*, Action_date([DUE],IIf(IsNull([WAIVER]),[DUE],[WAIVER])) AS Action_Date_Field, IIf([DUE]<[WAIVER],[WAIVER],[DUE]) AS Later
FROM TESTSTAT
WHERE [LOG_NO] LIKE '*'
ORDER BY Action_Indef([DUE],IIf(IsNull([WAIVER]),[DUE],[WAIVER]),[LOG_NO]);

Can someone provide me with a sutible sql equvalent to this code

Thank You
Mike

View 7 Replies View Related

Converting Access To Access Project Query Problem

Sep 18, 2007

Hello All,

I am working on a project that was started in access, but needs to be moved into an Access project so that It can be integrated with other forms. When I did this I realized that my database queries needed to be changed from Access to SQL code. for example instead of representing a date as #DATE# it needed to be represented as 'DATE'.

However I have one issue that I am having issues with.

I have a query that determines a few collumns by running information through a vb function and returning the result.

The issue is I do not know how to convert this code from Access to SQL so that it will work.

The code is

SELECT Action_Indef([DUE],IIf(IsNull([WAIVER]),[DUE],[WAIVER]),[LOG_NO]) AS [Action], TESTSTAT.*, Action_date([DUE],IIf(IsNull([WAIVER]),[DUE],[WAIVER])) AS Action_Date_Field, IIf([DUE]<[WAIVER],[WAIVER],[DUE]) AS Later
FROM TESTSTAT
WHERE [LOG_NO] LIKE '*'
ORDER BY Action_Indef([DUE],IIf(IsNull([WAIVER]),[DUE],[WAIVER]),[LOG_NO]);

Can someone provide me with a sutible sql equvalent to this code

Thank You
Mike

View 2 Replies View Related

New At Access: Update Simlar Text Fields In One Form Based On Another Form

Jun 13, 2006

I am very new at Microsoft Access. I have two forms, A and B, that are filled out by two different users. Form A gets filled out first than form B gets filled out. Each has a name box as well as a birthdate box and a few other similar text fields. However, each form also has a few distinctive fields. I was wondering how I could input the common information in Form A to Form B so the user of Form B does not have to spend time retyping the name and birthdates again. In other words, I want to synchronize the similar records between the two forms. I would like the values to appear in a table as well. I would greatly appreciate it if someone could help me with the visual basic code. Thank You.

View 1 Replies View Related

Forms :: Access 2010 - Opening New Form And Closing Current Form?

Mar 14, 2013

I am using Access 2010 - Version 14.0.61.29.5000 (32-bit)

I am building a custom Export Wizard to export data to Excel using the Report Wizard for the basic ideas.

All I am trying to do is have a [Back] button on a form to open another form and close the current form.

Private Sub cmdBack_Click()
DoCmd.OpenForm "frm_ExportWizardPage2", , , , , , Nz(Me.OpenArgs)
DoCmd.Close acForm, "frm_ExportWizardPage3"
End Sub

The new form is opening but then the current form is not closing. All forms are the same size, shape and positioned centrally although this should not make any difference.

Could this be anything to do with which form has the focus when I open the new form?

View 2 Replies View Related

How To Print Hidden Form Using Visible Form Only - MS Access 1 Table And 2 Forms

Nov 24, 2014

I have a Lost/Found property database which we use to keep record of the lost/found property and it is working fine.

As per our organization's policy, we keep the item(s) for up to three months in which if it gets restored to the owner then fair enough otherwise after three months the item(s) can be claimed by the "Finder". But for this very purpose we issue the Finder with a "Claim Receipt" which he/she should bring in when claiming for the item(s) after three months period. Therefore, It's just the right time to upgrade the database to a more professional level.

The database has one table and two forms.

One form (LostFoundForm) is visible to the user in which they enter data, this form has two sections; Item(s) & Finder's details and the second section is about Restoring details.

However the second form (ClaimReceiptForm) is hidden to the users (for manual data entry) and has only one section which is exactly the same as the first form's first section, i.e., Item(s) & Finder's details. This second form takes the data automatically from the first form because the table behind them is same and fields are same (please see attachment). Up to here it's all working fine.

I would like to introduce a Checkbox or a CommandButton in the LostFoundForm which when we click should pull up a msgbox asking "Do you want to print the receipt for this item(s)?" with a Yes/No option. On clicking "No" it should, obviously, settle down but on clicking "Yes" it should print the "corresponding record" from the ClaimReceiptForm.

View 3 Replies View Related

Forms :: Referring A Form Inside A Form Using Access 2007

Mar 10, 2013

I have a Form called X which contains a subform called Y. I have placed this Form inside another form called Z.

There is a CommandButton which when clicked must refer to the Subform. How do I do this?

I tried using [Z]![X]!Y, Form_Z.Form_X.Y, [Z]![X].Y but it throws an error saying the form name has been misspelled ...

View 4 Replies View Related

Forms :: Access Form Disappears In Form View

Apr 3, 2014

I have a form that I can view in Design view and layout view just fine.

BUT --

If I just try to open the form in from view, it disappears somewhere even though it says it's open.

If I view it in Layout view first, then Form view, it shows.

I've removed any code behind to try and figure out what's going on but it still happens.

View 1 Replies View Related

Reports :: How To Display Access Form In Excel Form

Dec 13, 2013

I have created a MS access form having a combobox,button.There I have coded like : When the user click on button,a report will be generated. I need to show the access form in the excel form.I have searched and got code,which only allows me to open the ms access not the form.

View 8 Replies View Related

How To Startup My Form Only Without Access's Default Form

Apr 19, 2006

I am trying to display only my form on startup.
Tools-Startup allows you to eliminate"Database window" default menu and toolbar but I can't eliminate "Microsoft Access" window.

I don't know if there are other settings that I am not aware of or there has to be code built.

Thanks in advance
Sebastian

View 8 Replies View Related

Access Elements In A Sub Form From Main Form

Jun 9, 2006

I have a form (called DeliverableDescription ) that has the following buttons: close, and save
the main from has a sub form (called DeliverableDescriptionsubform) that is viewed as a datasheet
also I have a table called DeliverableDescription that has three columns (outline number, name, and group number)

the DeliverableDescriptionsubformshows data from DeliverableDescription (only the outline number and name)
this DeliverableDescriptionsubform is used to update the DeliverableDescription table (through copy and paste from another source)

what I need to do is populate the group number column when the DeliverableDescriptionsubform is updated
the group number is just the first part of the outline number (i.e. if the outline number is 20.45.35.1.4.9 then the group number is 20)

I want to create a command in the save button that takes the string value of each item in outline number column and do some simple string manipulation to it then populate the group number

my approach is to have a select query that gives me all the outline number then through a loop iterate through each one, performing the string manipulation and update to the table.

my question is how to access elements in a sub form, since the save button is in the main DeliverableDescription form
also is there a better way to do this?

thanks for any help you might be able to offer.


Code:Dim ws As WorkspaceDim db As DatabaseDim rs As RecordsetDim OutlineNum As StringDim queryResult As StringDim returnResult As StringDim SearchChar As StringDim Pos1 As IntegerDim TotalLen As Integer OutlineNum = "SELECT DeliverableDescription.OutlineNumber " & _ "FROM DeliverableDescription " Set ws = DBEngine.Workspaces(0) Set db = ws.OpenDatabase("N:statusReport_Test.mdb") Set rs = db.OpenRecordset(OutlineNum) Do While Not rs.EOF queryResult = rs.Fields(0) TotalLen = Len(queryResult) SearchChar = "." Pos1 = InStr(queryResult, SearchChar) returnResult = Left(queryResult, Pos1 - 1) DoCmd.RunSQL ("Update DeliverableDescription SET DeliverableDescription.TeamLeadNumber = returnResult " & _ "WHERE DeliverableDescription.OutlineNumber = OutlineNum ;") queryResult = "" SearchChar = "" Pos1 = 0 rs.MoveNext If rs.EOF Then Exit Do End If Loop DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

View 2 Replies View Related

Converting Access Query To Pass-Through Query

Dec 23, 2005

Can anyone help? I have a query that queries against 11 linked views against an SQL Server backend.

The query is running dog slow, so I want to convert it to a pass-through query so that the processing is done server side rather than Access having to drag thousands of records across the network, but don't know where to start.

The problem is that I need to convert the Access SQL to a version of SQL that SQL Server understands.

Is there a tool I can use that does this automatically (keeping my fingers crossed here)? If not then does anyone know where I can find out how to do this?

View 2 Replies View Related







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