Executing A Query On Highlighted Record In Listbox

Jul 25, 2005

How do i apply a query that i want to execute only on a highlighted record in a listbox.

If there is a link, sample database or lines of code could you please assist.

Currently everything is being executed on all of the records in the query.


Also Does Access 2000 support codes for drag and drop forms?

View Replies


ADVERTISEMENT

Moving The Highlighted Value In A Listbox

Jul 13, 2005

How do you get the highlighted value to move with the keystrokes in a list box(ie. hit the b key and goes to first b in the list etc)

scratch

View 1 Replies View Related

Tricky - Highlight Listbox Pre-Loaded From Master Highlighted From Saved

Feb 13, 2006

Hello Everyone :D :

I have a reporting interface providing users with a multitude of reporting options and capabilities. One aspect involves utilizing the ability to allow users to save their settings on the interface due to the number of options provided. One of the aspects revolves around working with listboxes.

Each listbox is pre-loaded every time with a list of items from a master table pertaining to the listbox. The user selects their desired choices, saves*, etc...Once loading a setting, I'm looking to have the listbox pre-loaded (easy) but then auto highlighting the items selected or rather pulled from the user settings table (each listbox has own table for user saving of options). So, if a user selects items Alpha, Beta, Delta, and Falcon from a list of 100 choices, then those 4 items would be saved under that user setting, within the code table (user specific). When they load the setting back onto the user interface, it should pull the 100 choices and auto highlight the 4 items. Hopefully I've explained that properly.

*A user is able to save, save as, load settings, unload settings, etc...from the reporting interface. When a user saves settings, these settings are saved within the user settings tables. Each table varies depending on the nature of the values within the reporting interface. Listboxes have their own tables connected to the primary settings table.


Any ideas anyone? :rolleyes: :D

View 4 Replies View Related

Forms :: Open A Form For Adding Child Record Related To Highlighted Record In Subform

Oct 2, 2013

Is it possible to open a form to add a child record related to the highlighted record in the subform?

View 2 Replies View Related

Executing Query

Oct 15, 2007

Hi there,

I am trying to run a query from an ASP page, which also uses other queries. I get the following error message: [Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression 'Expr1' as part of an aggregate function, this is in qrySessionsEverything.


The query name is qrySessionsEverything.
It executes the line:

SELECT * FROM qrySessionsEverything

The queries are below:

qrySessionsEverything
SELECT tblSessions.SessionID AS Expr1, tblSessions.CourseID AS Expr2, tblCourses.CourseName AS Expr3, tblSessions.SessionDate AS Expr4, tblSessions.StartTime AS Expr5, tblSessions.EndTime AS Expr6, tblVenues.VenueID AS Expr7, tblVenues.VenueName AS Expr8, tblVenues.Capacity AS Expr9, tblVenues.Capacity-[bytAttendees] AS bytAvailablePlaces, qrySessionsAccepted.bytAttendees AS Expr10, tblVenues.Link AS Expr11, qrySessionsPending.Pending AS Expr12, [TrainerFirstName] & " " & [TrainerSurname] AS strTrainer, tblSessions.TrainerID AS Expr13
FROM tblTrainers, tblCourses, qrySessionsAccepted, qrySessionsPending, tblVenues, tblSessions
GROUP BY tblSessions.SessionID, tblSessions.CourseID, tblCourses.CourseName, tblSessions.SessionDate, tblSessions.StartTime, tblSessions.EndTime, tblVenues.VenueID, tblVenues.VenueName, tblVenues.Capacity, qrySessionsAccepted.bytAttendees, tblVenues.Link, qrySessionsPending.Pending, [TrainerFirstName] & " " & [TrainerSurname], tblSessions.TrainerID;

qrySessionsAccepted
SELECT tblSessions.SessionID AS Expr1, tblSessions.CourseID AS Expr2, tblSessions.SessionDate AS Expr3, tblSessions.StartTime AS Expr4, tblSessions.EndTime AS Expr5, tblSessions.VenueID AS Expr6, tblVenues.VenueName AS Expr7, tblVenues.Capacity AS Expr8, [Capacity]-[bytAttendees] AS bytAvailablePlaces, Count(qryDelegatesAccepted.DelegateID) AS bytAttendees, tblVenues.Link AS Expr9
FROM tblVenues, tblSessions, qryDelegatesAccepted
GROUP BY tblSessions.SessionID, tblSessions.CourseID, tblSessions.SessionDate, tblSessions.StartTime, tblSessions.EndTime, tblSessions.VenueID, tblVenues.VenueName, tblVenues.Capacity, tblVenues.Link
ORDER BY tblSessions.SessionDate, tblSessions.StartTime;

qrySessionsPending
SELECT tblSessions.SessionID AS Expr1, tblSessions.CourseID AS Expr2, tblSessions.SessionDate AS Expr3, tblSessions.StartTime AS Expr4, tblSessions.EndTime AS Expr5, tblSessions.VenueID AS Expr6, tblVenues.VenueName AS Expr7, tblVenues.Capacity AS Expr8, tblVenues.Link AS Expr9, Count(qryDelegatesPending.SessionID) AS bytPending
FROM tblVenues, tblSessions, qryDelegatesPending
GROUP BY tblSessions.SessionID, tblSessions.CourseID, tblSessions.SessionDate, tblSessions.StartTime, tblSessions.EndTime, tblSessions.VenueID, tblVenues.VenueName, tblVenues.Capacity, tblVenues.Link
ORDER BY tblSessions.SessionDate, tblSessions.StartTime;

qryDelegatesAccepted
SELECT tblDelegates.DelID AS Expr1, tblDelegates.SessionID AS Expr2, tblDelegates.DelTitle AS Expr3, tblDelegates.DelFirstName AS Expr4, tblDelegates.DelSurname AS Expr5, tblDelegates.DelHospital AS Expr6, tblDelegates.DelDepartment AS Expr7, tblDelegates.DelPhone AS Expr8, tblDelegates.DelBleeper AS Expr9, tblDelegates.DelEmail AS Expr10, tblDelegates.DateSubmitted AS Expr11, tblDelegates.Accepted AS Expr12, tblDelegates.Rejected AS Expr13
FROM tblDelegates
GROUP BY tblDelegates.DelegateID, tblDelegates.SessionID, tblDelegates.DelTitle, tblDelegates.DelFirstName, tblDelegates.DelSurname, tblDelegates.DelHospitall, tblDelegates.DelDepartment, tblDelegates.DelPhone, tblDelegates.DelBleeper, tblDelegates.DelEmail, tblDelegates.DateSubmitted, tblDelegates.Accepted, tblDelegates.Rejected
HAVING (((tblDelegates.Accepted)=True) And ((tblDelegates.Rejected)<>True));

qryDelegatesPending
SELECT tblDelegates.DelegateID AS Expr1, tblDelegates.SessionID AS Expr2, tblDelegates.DelTitle AS Expr3, tblDelegates.DelFirstName AS Expr4, tblDelegates.DelSurname AS Expr5, tblDelegates.DelHospitall AS Expr6, tblDelegates.DelDepartment AS Expr7, tblDelegates.DelPhone AS Expr8, tblDelegates.DelBleeper AS Expr9, tblDelegates.DelEmail AS Expr10, tblDelegates.DateSubmitted AS Expr11, tblDelegates.Accepted AS Expr12, tblDelegates.Rejected AS Expr13
FROM tblDelegates
GROUP BY tblDelegates.DelegateID, tblDelegates.SessionID, tblDelegates.DelTitle, tblDelegates.DelFirstName, tblDelegates.DelSurname, tblDelegates.DelHospital, tblDelegates.DelDepartment, tblDelegates.DelPhone, tblDelegates.strDelegateBleep, tblDelegates.DelEmail, tblDelegates.DateSubmitted, tblDelegates.Accepted, tblDelegates.Rejected
HAVING (((tblDelegates.Accepted)<>True) And ((tblDelegates.Rejected)<>True));


Please can you help me.

Thanks,
Bash.

View 1 Replies View Related

Executing Query In VBA

Oct 31, 2007

Hi, I am a beginner in access. I am trying to execute the below query through VBA on a click event on a Command Button in a Form. I am taking input parameter from Form, based on which I want the query result( dynamic Query Parameter).
I getting the attached error message

Please help me out in executing this query in VBA. An example would be of great help. Thanks in advance..

View 14 Replies View Related

Create Custom Box Before Executing Query

Jan 9, 2012

I am looking to check, whether i would be able to "add an Message box with a "Message : "Executes all queries all is well.mdb before executing this query ?" , if yes, continue executing the query, else, Exit out of the database?

View 1 Replies View Related

Executing A Query On Periodic Basis At Midnight At 00:05

Oct 31, 2005

I am trying to execute query every midnight at 00:05 and append data into a table. This query reads the data from a linked table and appends the records into the local table.

Access doesn't triggers so I have no clue which way to proceed.

Can anybody help me creating a logic to execute query at midnight?

Regards
Giri

View 2 Replies View Related

Storing A Calculation As A String In A Table And Executing It In A Query.

Jun 11, 2007

N.B. This is not your usual 'Bad practice to Store calculated values in a table' post

I have a table of items.
Each item has a different formula attached which I need to store as a literal value in the table and execute it as a normal expression in a query or vb.

e.g

Columns:Item, QTY, Hrs, mins, ItemFormula
Data: Car, 2, 7, 3, [QTY]+ [Hrs]/[mins]

So ' [QTY]+ [Hrs]/[mins]' would literally be stored for that rercod and is how it would be displayed in a table, form, report etc as it is important for the user to see how the calculation is performed as well as seeing the end result which will be calculated as normal in vb or a query.
The formula will vary from record to record.

How do I go about this?

TIA

View 6 Replies View Related

Forms :: Requery 2nd Subform When Different Record Highlighted On First Subform

Sep 3, 2013

I have two sub forms on a main form.Subform 1 displays information which comes from a query, filtered using two combo boxes on the same form.The active record on the data sheet has two field values output to hidden text boxes on the form.

These text boxes then provide the values used for the query displayed on the 2nd sub form.When I highlight a new record in subform 1, the text box values change, but the values in sub form 2 do no.Which would be the best method to use to get this to requery?

View 10 Replies View Related

Forms :: Listbox Bound To Query - Select Only One Record

May 12, 2014

I have a list box bound to a query. If the list box retrieves two records, I am not able to select only one of them. If I click, it gets both records selected ( highlighted ). Is there any way I can select only one record?

View 8 Replies View Related

Copying Data Within Same Form From A Listbox Containing A Query To A Blank Listbox?

Apr 21, 2006

Hi, I'm new here, so I hope I'm posting this in the correct place. I've searched the forum to see if there are any existing threads that might help me, but I've not found anything that does...
(I think this thread ( http://www.access-programmers.co.uk/forums/showthread.php?t=93444&highlight=Copying+data )may be trying to achieve something similar to me, but I'm a beginner and don't really understand it)

I shall stop waffling! I'm not entirely sure that what I'm trying to achieve is possible, I expect it probably is!

Right, I have a form (frmGroupRegister, which contains exactly the same fields as the table it comes from, tblGroupRegister), which consists of three things:

-GroupDate - The date a group took place on. It is my primary key, as no more than one group occurs on a specific date.

-ParentList (A listbox which contains a query showing the ID number, forename and surname of everyone in a table, tblParentDetails)

-ParentsAttending (A blank listbox)

I would like to place buttons in between the ParentList and ParentsAttending, which would allow users to conduct a 'register' of attendance by copying individual/multiple details from ParentList into ParentsAttending (much like you get when choosing which fields to include in a form when using a wizard for example). I would also like them to be able to remove people from ParentsAttending by using a button in case of accidentally adding the wrong person into the ParentsAttending box.

I'm aware that another, probably simpler way of achieving this would be to use a tick-box system, but I feel that visually, the first method would both look better and demonstrate who is present more clearly.

Any help would be much appreciated, but my Access skills are quite basic and things will probably need to be spelled out for me.
I'm using Access 2000 and Windows XP.
Thanks for your help,
Alice :)

View 1 Replies View Related

Forms :: Click Record In Listbox And Combobox Jumps To Same Record?

Aug 25, 2014

I have been looking for days on the net for my listbox problem. It is there and found a few, even on this forum. but when i try the solutions mentioned i am in a total loss and do not know what to change to make it work for me.

I have a form named A/B Retriever with a record source qry input AB Bins Than i have a unbound combobox with row source qry input AB Bins. This populates 8 textboxes with B through I carton boxes, stored in a bin. The user selects a Bin location from the combobox and can put a "x" in a textbox to illustrate that the box is empty. This works perfect.

Underneath the input bin and box part i have 8 listboxes that shows a query that has counted the empty boxes with the corresponding bin location. this also works. but the question from users where, If i click on a, lets say empty B-box at Bin location 12A20, they want the combobox automatically focus on the combobox with the corresponding Bin location. This is a quick way for them to delete a empty box (remove the X).

View 1 Replies View Related

Autosum For Highlighted Feilds

Sep 21, 2006

Can anyone please help or advise where I can look for help on this problem.
I have a subform which shows all my outstanding orders. Below it is a calculated field which shows the total weight of all the orders. (Steel Beams)
I would like to be able to highlight the weights on certain orders & show total weight for only these orders. (Similar to the way it can be done in excel)
I have been trying to do it via a query with a Yes/No check box & when I check the orders required the total weight changes. But I cannot get it to work properly as this puts a Yes in the field & the record disappears.
I only want it for a quick reference to save doing mental summing up so don’t want to change or add anything to a field to get answer.
Can anyone give me any ideas please?

Tks

View 4 Replies View Related

Modules & VBA :: Highlighted Fields In Form?

Jan 31, 2014

I have a numeric value in table A followed by its form, i need to highlight the filed at form if the numeric value becomes same for table A & B this i want to do with the form of table A no matter what the color of highlight is.

View 1 Replies View Related

Modules & VBA :: Read Currently Selected (highlighted) Row In Table?

Jun 22, 2013

I am interested, is it possible to read currently selected (highlighted) row in table?

I know that this is possible to move cursor on concrete field in table via VBA but is it possible to read record number when we move cursor manually (via arrows)?

View 13 Replies View Related

Reports :: Detail Section Randomly Highlighted

May 18, 2015

when i generate a report i intermittently get a page that has the detail section highlighted. The report generates an invoice for each customer selected, a new page for each invoice with a repeating header on each page. I have used the vba to some of the formatting on the page. Usually there are between 20-40 pages generated with each report, or there is an option to print just one invoice. I get the highlight on 1 page on some set of invoices, and other everything works fine.

I can not for the life of me figure out what variables are causing the detail section to be highlighted. Does not repeat on a specific customer, place in the report, or any specific that i can tell. What settings/variables/triggers/events would cause the detail section to become highlighted blue.

Right now i can generate the report, see a blue page(usually after its printed), and the regenerate it and its not there or on a different page. The invoices uploaded are for the same person generated right after each other..

View 3 Replies View Related

SQL INSERT -- Asking For Parameters When Executing?!

Jul 22, 2005

Hi all,

I've searched for a solution, and the proposed solution didn't work for me.

I am executing an SQL statement to insert values into a History table when deleting a value in a subform. Two of the 5 values are asking me for parameters when the SQL executes and I cant figure out why! The datatypes they are inserting into are correct and I'm at a loss. The 2 values giving me grief are Manufacturer and Model.

Here's the code:

Dim sSQLMachHistory As String

MsgBox "me.acctid: " & Me.AccountID
MsgBox "me.manufac: " & Me.Manufacturer & " me.serial: " & Me.SerialNumber
MsgBox "model: " & Me.Model

'Insert into History Table:
sSQLMachHistory = "INSERT INTO tblMachineHistory (SerialNumber, Manufacturer, Model, AccountID, MachineID) VALUES (" & Me.SerialNumber & ", " & Me.Manufacturer & ", " & Me.Model & ", " & Me.AccountID & ", " & Me.MachineID & ")"

MsgBox sSQLMachHistory

DoCmd.SetWarnings False
DoCmd.RunSQL sSQLMachHistory
DoCmd.SetWarnings True

My message boxes show me all the values are displaying and should be inserting into the table -- any ideas??? :confused:

cheers

Mike

View 2 Replies View Related

New Field Value From Large Table Column To Be Highlighted In Report

Sep 3, 2015

I have a daily report that shows data from previous day for production. When we have new products produced, I would like a field to be highlighted if it is the first time it has come up. I do not want it a unique field just from yesterday, but to analyze the table of all of the production days and highlight if a particular field from a column is unique. Can this be done?

View 6 Replies View Related

Executing Code On Database Open?

Apr 10, 2007

hi,

I was wandering if it is possible to implicitly execute code upon the opening of a database? If so how do I do this? I have code to convert the page settings of a report from a command click but wanted this to be done automatically...

cheers

tania

View 6 Replies View Related

BeforeUpdate Event Executing Too Many Times

Oct 16, 2005

I have a mainform with a search function so the user can select a record to view and update. The selected record is displayed in Subform1 on Page1 of a tab control. The record source of this form is Query1. Page2 of the tab control contains Subform2; record source is the result of Query1 joined to Query2.

The forms correctly displays, updates and adds records my problem occurs when I add VBA code to the BeforeUpdate event of a control on Subform1. The code appears to execute once for each page in the tab control.

Has anyone any suggestions on how I can correct my problem.

Thanks

Fearless

View 3 Replies View Related

Having Trouble In Executing TreeCtrl Code

Jul 11, 2006

Hi,

I am having trouble in implementing the TreeCtrl structure. I have a simple database for testing purpose and I am not able to make it work. There appears to be a problem with the bookmark property and I get an error message:
"can't Add child:Arguments are of wrong Type, are out of acceptable range, or are in conflict with one another".

I have attached the database here and could you please see what is wrong with my code.


Thanks
Priya

View 5 Replies View Related

Executing Command Buttons On Other Forms

Sep 20, 2004

Hi

I have a Visible form and an Invisible (visible=false) form open at the same time. Is it possible to use a button on the visible form to execute the code behind a button in the invisible form. The subroutine on the invisible form is Public. I tried DoCmd.RunCommand and a macro with RunCode but... nada...

(There is a valid reason for this approach but i will spare you the boring explanation. I can think of a work around where I can bypass this need, but this way is cleaner (there are cases where the invisible form is visible and used directly, the form has data which is sent to a report to create a label). I have done everything else with VBA code but for some reason can't get this to work, so now i am obsessed)

Thanks, this forum is really a gem!

View 2 Replies View Related

Executing An Update Command With “'” In The String

Nov 3, 2006

Hi,
I try to execute an update command i.e.:
UPDATE Results set Data = 'Heiner's key' where ValidationNumber = 1 and TestNumber = 2 and Line = 'E1'.
Access does not let me do this because the “'” in Heiner's terminates the update string prematurely.
Does anyone have a suggestion how to do this? Thank you.

View 4 Replies View Related

Modules & VBA :: Identifying Highlighted Or Bold Cells To Import Into Access

Jun 12, 2014

I receive a bunch of excel files with items to be added to a database. some of the items are to be added as new, some to be deleted and others to be modified.

I identify the action (add/delete/modify) by looking at a column in the excel file e.g. column A.

At this point I am fine with the add/delete because I can filter the data or bring all the files to a temporary table in an Access database via vba script and then running queries to do the rest.

My issue is that the spreadsheets have a lot of columns and for the modifications what they do is use the same file for instance, make changes on the cells (any cell) that need modification and then highlight, bold or underline only the items that need modification and ignore the rest of the file (a tedious process since I have to then open each file and manually modify the database).

View 1 Replies View Related

Executing A Subforms Procedures From The Parent Form

Dec 19, 2005

is there a way i can call a sub forms procedure from the main parent form.

in other words i have a button command i want to execute

View 2 Replies View Related







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