Need Help!!! Queries And Commands

Feb 28, 2006

hi,

i need serious help with my access project...

im designing a database for videoshop for loans in access. i have got my movies and loans tables (along with others) and have got them as a one to many (loans to movies) and have got Rental ID as Primary key in Loans table and got that linked to Rental ID# in movies table.

i want some sort of command in the loans form so that when a customer loans out a movie it will update the movies table (rented out field).

the fields that i have got in the loans table are:

Rental ID
Customer ID#
Movie Rented Out
Date Rented Out
Other Rental Details
Rental Duration
Daily Fine Rate

the fields in the movies table are:

Movie Title
Movie Quantity
Movie Description
Genres
Rating
Director
Popularity
Rented Out
In Stock
Supplier ID#
Rental ID#
Stores ID#


if anyone whos reading this knows how i can do this then it will be highly appreciated if u replied to this thread.

thankssssssssssssssssss.....

adeel.

View Replies


ADVERTISEMENT

How To Enter Commands In Command Line To Type Queries

Oct 3, 2014

I have had my 4th SQL/APP Dev lab class, however I missed the 5th.

Our 5th lab was .

1. Create 3 tables, populate with given data and create relationships. 'Customer, Invoice, Payment'

2. We were given 8 queries to try do, we had to come up with which commands would be used.

I have no 1 completed.

As for no 2.. we are still learning all the commands, so the lab here is for us to find what commands we think will be used. I have researched and have them all 6 queries we have to run.., I have all those commands written out on paper which I think are answers..how to find the command line to test them.

I'm using Access 2007 on Windows 7.

View 1 Replies View Related

Access Commands Vs SQL Commands

Sep 23, 2004

Does anyone have a source that lists basic Access (2000) commands. I have training in SQL server (so I am just starting out) but I am working with Access and the commands aren't always the same and the help files in Access aren't much help.

My immediate need is to find the equivelant of the go command. I am trying to build one query with multiple update statements.

View 2 Replies View Related

Subform Commands

Sep 22, 2005

i have a subform which appears on numerous forms,

in this subform thereare fields with dbl_click commands to open other forms

however, on one parent form where this subform appears, i wish 2 queries to run prior to the form closing

i have one way, which is very messy, and involves updating unbound controls to feed iif statements

is there another way thru utilising some public functions, and or active screen properties, that would be more efficient.

many thanks

View 2 Replies View Related

Issue System Commands From VBA?

May 23, 2005

Hello,

I would like to issue a system command from within a VBA function. Specifically, I'd like to start another application using a command-line startup command, but am not sure how to do that.

Any suggestions?

Tom

View 2 Replies View Related

Using Custom Menu Bar Commands

Jun 7, 2005

Hi all,
I was wondering if you could use custom menu bar commands to open reports and varying the recordsource of the reports according to which command you choose. For instance, if the user wants to view a report for January, he clicks on the January menu bar button. And I do not wish to use macros as there might be many macros to use.

Was looking at it and I am able to use my own vb functions but was wondering if I could use the tag field under the customise menu bar command to specify which records to filter to?

Maybe I should just use a form with all the code behind. lol... :p

View 2 Replies View Related

A Form Button That Does Two Commands

Oct 11, 2004

I have created a query that has the info for a quick search. What I want to do is create a form that I type the last name of my customer and then click a button that opens the query and filters out all records that don't match the criteria I enter. I want the button on the form to do both. Is thie possible? If so how? Please Help. Very much appreciated

Biz

View 3 Replies View Related

Execute Commands From ListBox

Nov 22, 2005

There is one table Name "Menu"

Code:MenuTitle MenuCommand----------------------------------Add Customer docmd.openform "frmAddCust"Print Customer docmd.openReport "rptCust" ,acpreview

Know i want to execute menucommand when i select menuTitle in listBox.
Please Help How can i do this.

Integer

View 1 Replies View Related

Logic Commands: IF Function

Feb 26, 2007

I have been working on customizing MS ACCESS to
produce a report that involves one mathematical
computation from my input data. However, I've run
into a problem because I can't get the program to
carry out a logic command that would work fine in
MS Excel: the "IF" command. Specifically, what I'm
doing involves a calculation, where one data input is
subtracted from another data input, but if the difference
is a negative number, I would like to substitute the value
of ZERO. The closest I've come to achieving this is to
enter the condition ">0" while in Query Design mode, but
the problem with this approach is that if the difference
is a negative number, the report does not display the
data that resulted in the calculation of the negative number.
In other words, I want the data to be included in the report,
but I want a "Zero" to be substituted for all calculations that
produce a negative number. For example, if I enter a set of
data, and the two numbers that get subtracted are 40 minus
36, then the difference is positive 4, and so I want a "4" to
be displayed; But if the two numbers to be subtracted are
36 minus 40, the result is negative, and so I'd want the
report to display a "zero" in the calculation.
Please advise me on how to set this up, as the only approach
I've found resulted in all negative calculations being omitted
from the report.
Thanks for your help.

View 6 Replies View Related

Modules & VBA :: DOS Commands In Access

Mar 13, 2014

I was quite familiar with DOS commands and was able to create access DBs and write the VBA button code. However that was quite a few years ago and Ive forgotten it all.For every image file in DIR A or subdirectory If that image file exists in DIR B, then delete the image in DIR B.

View 3 Replies View Related

Refering To Menu Bar Commands And Sub Menus

Aug 1, 2005

I have a custom menu bar that has a couple of menu lists, with a list of five custom commands that i want to run,depending on what is selected.I know you can assign a macro to each command,but is there a way to know which command has been selected.
What i want to do is to have 1 macro that will run several functions depending on what was selected, rather than 1 macro for each button

View 1 Replies View Related

Zooming Commands When Working With Relationships

Jan 26, 2012

Zooming commands when working with relationships

1.Im wondering why there is no option to zoom in and out as we are working with relationships.
2.And even the option show all is not working; some of the tables in the relationship are kept hidden (screenshot is attached)! How could we work in this environment?
3.I do know the I can use the scroll bars, but they are not enough to perform the work more professionally

These features are available in most of the software!to zoom in/out To pan .To zoom all (extent Where are they in the relationship in Access?

View 2 Replies View Related

VBA Commands To Import DBF Files Into New Table

Feb 26, 2015

I've been creating an automated way for users to import an existing DBF III file into an Access Table and then I'll be doing some other things after it's in. The user needs to be able to click a command button to open up a file picker, select the desired DBF and then click import and have it be imported into a new table.

Originally I had this all working because there was only one possible file name for the DBF file in each folder so instead of using a file picker I used a folder picker and supplied the file name in the VBA code as it was static.

However, I now need the user to be able to select a specific file and the name could be anything.

I've successfully edited the file picker to allow them to select a file however the importing is an issue. In order to do a TransferDatabase command I need the file path alone for DatabaseName and the file name alone for Source.

What would be the best way to split those two pieces of data up once the user has selected the file they need?

View 1 Replies View Related

Forms :: Functional Keys To Perform Commands?

May 2, 2014

tell me that can we use functional keys F1, F2,F3,,,,,,,,,,,,,,F12 in ms access to perform commands like saving a form data , for closing form refreshing form, clear form.Or is there any way to make shortcut keys combination like[(ctrl+s)(ctrl+c) (ctrl+A)] in access to perform action like saving,closing,clearing, current form.

View 1 Replies View Related

Modules & VBA :: How To Run Multiple SQL Commands On Click Of A Button

Jul 25, 2013

I want to run multiple SQL commands on click of a button. I have these three command,

CurrentDb.Execute "INSERT INTO UserMadeDeviceT(Product, ORESector) " & _
" VALUES ('" & Me.D_NewDeviceTxt & "', '" & Me.D_ORECmb & "')"
CurrentDb.Execute "INSERT INTO UserMadeDeviceT (RatedKilowattPower, KilogramWeight)" & _
" SELECT RatedKilowattPower, Weight FROM UserSelectedComponentT " & _
" WHERE [TotalComponent] = '" & D_ComponentNameCmb & "'"
CurrentDb.Execute "INSERT INTO UserMadeDeviceT (Cost) SELECT SUM (EuroCost) FROM UserSelectedComponentT"

all of these work indevidually and return the correct value but the add three rows to the table. How can I combine these three commands into one so that it will only add one entry?

View 8 Replies View Related

Tables :: Creating Table Within Existing Database Using SQL Commands

Apr 8, 2015

I was asked to create a table within an existing database using these SQL commands;

CREATE TABLE Vehicle (reg_no TEXT(10)
CONSTRAINT VehicleKey PRIMARY KEY,
type TEXT(10),
purchase_date DATETIME,
last_service_date DATETIME, mileage_at_last_service INTEGER);

I was told to save the query and check the new table had the required records in it.

I had huge problems when I tried to save the query and kept getting error messages like: "query must have at least one destination field" and "syntax error in field destination". This was strange since I was sure I typed the query exactly as it had been written on the worksheet.

Having not changed the SQL command at all it eventually worked when I skipped the 'save query" stage and just went to the "run query" stage. I still don't know why it actually worked in the end and why I kept getting error messages.By running the query am I supposed to just click on "RUN" or can I check the information first by looking at datasheet view?

View 6 Replies View Related

Forms :: Button Activate Yes / No Question To Continue Commands

May 2, 2013

I have a button on my form, that runs a series of queries then closes the form. It works great!!

How can I get the MsgBox feature to continue with all commands or cancel and close the form?

Here is my code without message box action

Private Sub AcceptChanges_Click()
DoCmd.SetWarnings False
Forms!SelectCustomerNewCustomerF!MergedRecordsF!CustomerID = Me.SecondID
Forms!SelectCustomerNewCustomerF!MergedRecordsF!MergedTo = Me.IDprimary
Forms!SelectPrimaryNewCustomerF!MergedRecordsF!UserID = Me.UserIdChange
DoEvents

[Code] ....

All of these actions work great, and do not need to be modified. it is just a msg box button to continue or cancel and close the form.

View 2 Replies View Related

Modules & VBA :: Send Commands To External Device Using A Serial Port

Dec 10, 2013

I need to send commands to an external device using a serial port.My understanding is that that I need to select the reference to the Microsoft Communications Control (MScomm32.ocx).But is not available in the list of references!

View 2 Replies View Related

Forms :: Creating Command Button On Form Containing Drop Down List Of Commands?

Nov 30, 2013

I wish to create a forms that has command button which display a drop down list. The drop down list should contain commands for reports and forms.

Lets assume we have forms named FrmStock, FrmSales and we also have Reports named RptUserLog , RptTurnover.

View 3 Replies View Related

Queries :: Unable To Open Or Design Queries From Older Access Files

Jan 1, 2014

Im trying to work on an db in Access 2007 that was migrated from Access 2003 (in fact its been migrated several times starting from Access 97). It executes and runs with no problems in both versions.
The problem is when trying to open some queries (not all) - Access is unable to open the query in design mode and gives me this error :

" is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.

However, as I cant open it - I cant check it. Im pretty sure none of the fields have invalid characters (they do have spaces) and Im not sure how long is too long....

View 6 Replies View Related

Queries :: Running Multiple Queries To 1 Excel File With Different Tabs For Each Query

Jul 18, 2013

I'm using Access 2003 and excel 2003.

We currently manually run 5 different queries then copy and paste this data into 5 separate tabs on 1 workbook, I'm trying to automate some of this process if possible.

I am trying to use the 'transferspreadsheet' action within a macro to run a query and post it into a template excel file, using this code:

Trasfer Type Export
Spreadsheet Type Excel 8-10
Table Name (query Name)
FIle Name (FIle location)
Has field names No
Range Blank
----
This does seem to work and puts the data on a new tab on the specified workbook.

However I have a few questions:

1. Can you specify which query gets put onto which tab in excel? The tabs have different fixed names.

2. Can you specify which Cell the data gets pasted into to? As each tab has a set of headers and titles which need to remain.i.e would need to get query 1 to start in cell A4.

3. How would you expand the above out so that it runs all 5 queries, would you just add in multiple transfer spreadsheet actions in the same macro?

View 1 Replies View Related

Queries :: Method For Combining Crosstab Queries With Same Criteria From Multiple Fields?

Dec 2, 2014

I have 3 cross tab queries that are completely identical with the exception of the field that they pivot. Each field is searching for the same values just in different columns, with the end goal being to get the sum of the values for each pivoted column. I'm wondering rather than having 3 almost identical queries is there a way to use a crosstab to sum the values from each of the three fields rather that having 3 queries which then have to be aggregated in a fourth?

QUERY1

Code:
TRANSFORM
IIf(Count(PT_LEVEL.UNIT) Is Null,0,Count(PT_LEVEL.UNIT)) AS CountOfUNIT
SELECT
PT_LEVEL.INF_YEAR,
PT_LEVEL.INF_MONTH,
PT_LEVEL.UNIT

[code]...

View 2 Replies View Related

Queries :: Crosstab Queries - Export Command Ask To Enter Date Parameter Twice

Feb 24, 2015

I have a crosstab queries which uses the date query parameters. However, when I go to my Export command (code is below), it ask me to enter the date parameters (start date and end date) twice. What do I have to do so that the system will ask me to enter once only?

Code:
On Error GoTo Err_cmdTest_Click
'Must 1st set a Reference to the Microsoft Office XX.X Object Library
Dim dlgOpen As FileDialog
Dim strExportPath As String
Const conOBJECT_TO_EXPORT As String = "qryEXPORT"

[Code] .....

View 9 Replies View Related

Queries :: Joining 3 Queries And Displaying Results In Separate Columns

Jul 31, 2013

I have 3 queries named Mech Final Equipment 3 Mth, Mech Final Equipment 6 Mth, and Mech Historical Final Equipment.They all have two fields-Final equipment and Sum of Sum of Down (calculating the number of minutes each piece of equipment was down in the time period selected).

My ultimate goal is to join the three queries to display a pivot chart that uses the Final Equipment as the category field and 3 Mth, 6Mth, and Historical as seperate data fields.What I have is a join query (Which I have named Mech Final Equipment H63 Joined)

Using this SQL:

Code:

SELECT DISTINCTROW [Mech Final Equipment 3 Mth].[Final Equipment], Sum([Mech Final Equipment 3 Mth].[Sum Of Down]) AS Duration
FROM [Mech Final Equipment 3 Mth]
GROUP BY [Mech Final Equipment 3 Mth].[Final Equipment]
UNION

[code]...

Which returns a table that looks like this:

Final Equipment, Duration

Ancillary Equipment, 225
Ancillary Equipment, 401
Ancillary Equipment, 1787
Brush Unit , 1252
Brush Unit , 2519
Brush Unit , 8004

And so on.What I need the table to look like is this

Final Equipment, 3 Mth, 6 Mth, Historical

Ancillary Equipment, 225, 401, 1787
Brush Unit, 1252, 2519, 8004

And so on, like a cross tab.I tried to do a crosstab query but I don't have enough fields.

View 6 Replies View Related

Queries :: MS Access 2010 - Export Queries Into One Workbook But Different Worksheet

Jul 16, 2013

I have three Queries and I need to export three queries into one workbook but different worksheet,

Currently I am using ExportWithFormatting , but the result came out is three different workbook .

Is there any way I can export to one workbook ?

View 3 Replies View Related

Queries :: Adding Calculations To Queries Based On Columns In Query

Feb 18, 2014

I am trying to add calculations to queries based on columns in the query... it seems to randomly expect 'Expression' or 'Group by' as column types, and Im having to create 3 sets of queries following on from each other to de-dupe data and allow filters on calculated values.

Also I've got a function which turns a date into a quarterly cohort, e.g. Oct 2013 -> 20134. I use ot on a lot of dates. I created a VBA function, CohortQ used as follows in queries:

Cohort: IIf Year([InputDate]) < 1990 or Year([InputDate]) > 2020, 0 CohortQ([InputDate]))

In the VBA, InputDate is defined as a date

Code:
Function CohortQ(InputDate As Date) As Integer
If InputDate = 0 Then
CohortQ = 0
Exit Function
End If

[Code] .....

But when I run it on a date field, it gives me a data mismatch error. I can't step through as it's working on 600K rows.
If I put the function into the query,

Cohort: IIf Year([InputDate]) < 1990 or Year([InputDate]) > 2020, 0 Year([InputDate])*10+DatePart("q",[InputDate]))

it works.

View 3 Replies View Related







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