Populate Combo Box From Values Through Query And Hard Coded Value At Same Time
Jun 18, 2015
Currently I have a combo box in my access 2007 application which is drawing its value through a table using a SQL Query. I would also like it to show up a hard coded value in addition to the current list.
View Replies
ADVERTISEMENT
Feb 6, 2006
Having one of those days!!!
I have a simple query populating fields from 2 tables and would like to add a further field to my query (not in tables)
In this field I wish to hard code in 2 values. Can anyone suggest the best way of doing this?
Thanks
Paul
View 1 Replies
View Related
Aug 2, 2006
I have something like this
Code:'sets generic workspace Set ws = DBEngine.Workspaces(0) 'sets target database from workspace ******NOTE hardcoded path****** Set db = ws.OpenDatabase("E:Status ReportstatusReport_Test.mdb") 'sets Recordset to deliverablePercentComplete sql statement for target database Set rs1 = db.OpenRecordset(deliverablePercentComplete)
is there a way to replace the path in the set db call, basically it is the current database that is being worked on, thus it is the current database that is opened, is there a way to say something like...
set db = ws.OpenDatabase(currentDB)
View 1 Replies
View Related
Aug 17, 2006
Hello buddies :D, do you have any idea how to make this work?
To select data that falls within this criteria of date range between cboDate and cboDate2 (fields on my form). The date in [tblJobDetails]![timeIn] come in this format "08/17/06 10:24 AM", but the cboDate/cboDate2 (takes in date only e.g 08/17/06) what i am after is to evaluate specific hard coded time in addition to the date entered, i.e. even tho, i haven't entered time on the cboDate/cboDate2, I want specific time hard coded where e.g If i select a date range of 08/17/06 and 08/18/06 on my cboDate and cboDate2 it should really be evaluating: 08/17/06 8:00 AM to 08/18/06 8:00 AM.
This is the criteria i curentlly have on my query in design view tha works perfect in selecting date only.
([tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Or [tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Is Null) And ([tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Or [tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Is Null)
How can I incorporate 8:00am to 8:00am into my cboDate and cboDate2. What can i do to make this happen? Your kindness will be greatly appreciated http://www.naijaryders.com/forums/images/smilies/thankyou.gif
View 10 Replies
View Related
Aug 5, 2013
I have several comboboxes (6) on my form.How to populate these comboboxes with values depending on selected value in previous combobox.
Example.Lets say that you select value "Audi" in combobox 1, then available values in combobox 2 should be "A4","A6","TT" etc. and if you selected "BMW" in combobox 1, then available values in combobox 2 should be "3-series", "5-series" etc...
View 1 Replies
View Related
Sep 3, 2005
I want to create a query that extract rows that has a specific word.
i.e.
select * fro table where field like "*ART*"
however it should not retrieve "DART" or "ARTI"
i tried using the following [!a-z] and * like this:
SELECT * from DLs where DLName like "*[!a-z]ART" or DLName like "*[!a-z]ART[!a-z]*" or DLName like "ART[!a-r,s,!t-z]*" or DLName like "ART"
it is very long and complicated - cant i cover it all with one like ?
Also the fact that i also want it to get ARTS (i dont know how to say !a-z expect 's')
Thanx in advance
View 2 Replies
View Related
Sep 9, 2013
I am trying to populate a list box with an event after update in a combo box. I can get the formula to work using 2 criteria, the problem is i nee to add a third criteria. When I try to add it I get the run-time 13 error.
Here is the code I am trying to use:
Private Sub cboStatusRFQ_AfterUpdate()
Me.cboSupplier.RowSource = "SELECT DISTINCT [Consolidated_Master_Req_Pool.RFQ Contact] " & _
"FROM Consolidated_Master_Req_Pool " & _
"WHERE consolidated_master_req_pool.Complete = FALSE AND [Consolidated_Master_Req_Pool.RFQ Supplier] = '" & Nz(cboStatusRFQ.Value) & "'" And "[cosolidated_master_req_pool.Status] = '" & "[SUPPLIER_RFQ FOLLOW-UP]" & "'" & _
"ORDER BY [Consolidated_Master_Req_Pool.RFQ Contact];"
Me.cboSupplier = Null
End Sub
View 2 Replies
View Related
Apr 14, 2008
Hallo,
I need your guidance to do the following;
On a click of a button from the Form the following should execute.
I have created 50 queries. Each query has more than 1000 recordsets.
1. I want to count the number of rows for each query (50 queries = 50 different values)
2. create one table and populate those 50 different values into the table
3. Using those values in the table; a Stack column chart has to be created.
In simple explanation; on a click of a button the data should be processed and chart has to be created.
Just a tip will also do to try on my side.
Thank you in advance
View 1 Replies
View Related
Jan 2, 2015
created a query (in Access 2010) that joins several linked tables (to an Oracle database). The query runs in about 20 seconds when I filter with a hard coded date (e.g., #12/31/2014#). The Oracle table column Im filtering on is defined as date/time.
When I attempt to change the hard coded value to a soft coded value (e.g., Forms![Form1]![Latest_Extract_Date]), the query runs over 5 minutes. In this case, the form field has the exact same value (12/31/2014).
Ive encountered similar issues using Access 2000, 2003, etc. This is quite frustrating. Does Access interpret #date value# is a special way? Is there a way to trick Access into the thinking a soft coded date is a hard coded date?
View 1 Replies
View Related
Nov 8, 2013
I have a database that stores information for lab testing. Each time a tech does a "step" in the test process he logs it in the table, using an input form. There are different categories, for example preparation, testing, analysis, etc, and each of those steps take time. I have the form autopopulate the date and time with NOW() evertime the form is updated. What i want to do is calculate the time it takes to do each in days. I can easily get how many days it was from now since they logged the test, =NOW()-TestDateTime. What I want to do is get the number of days it took to do each step, ie the number of days between each event. Is there a way to do this?
View 3 Replies
View Related
Nov 26, 2004
I have 2 questions which are linked. I am trying to run a query based on a selection from a combo box. Would someone be so kind to indicte if i need to use VB or can i do it directly from Access?
I have made the query and the combo box table but i am unable to get the combo box selection to be used in the query.
Additionally i want the query to look at a date range. In the query criteria i use "=now()" but i want the combo box selection to populate the rest of the criteria so it look like =now()+ XXX where XXX = a number of days, eg 14 or 30.
Any help would be gratefully received.
View 2 Replies
View Related
Sep 24, 2013
My company is finally using my accounts package (alongside our original package until we can be certain there are no bugs).
Anyway just adding nice to have features at the moment.
I've got a form that has 5 combo boxes where the user can select 5 customers. Then a button so they can graph the amount of money generated by each customer and compare them.
I've just made a query to return the top 5 highest grossing customers.
What I what to do now it feed the query results into the combobox values when I press a new button on my form.
How do I go about this?
View 1 Replies
View Related
Jul 8, 2005
My DB has a table named noldba.int_member_history, which contains the following fields:
member_id,
date_start,
date_end,
member_status,
iva_case_id,
case_id,
It is possible for the member to have several lines of data under their same member_id like this:
member_id date_start date_end member_status iva_case_id case_id
20125626 12/1/1990 2/31/1990 N 21116625 20002717C
20125626 1/1/1991 4/30/1992 A 62574431A 20002717C
20125626 5/1/1992 8/31/2000 N 20006625 20002717C
20125626 9/1/2000 12/31/9999 M 21116625 20002717C
20125626 8/1/2000 12/31/9999 M 20111832 20090698C
So this member had 4 start and end dates under case 20002717C
and only 1 start and end date under case 20090698C
I'm trying to write a query which is looking for member_id's along with a case_id which only has one member_status returned from the query and the
member_status must be M. In this case the member has two cases which have the M member_status, but case 20002717C has other types of member status so I would not want the query to return the 20002717C case, only the 20090698C
I'm sure Im asking for something that can't be done...but I'd never know unless I asked. Thanks
View 1 Replies
View Related
May 3, 2008
Hello all, I am trying to dispay results in a query which is based upon time.
e.g.
Sample data - class and class start time
Class one - 7pm
Class two - 7pm
Class three - 7pm
Class Four - 8pm
Class Five - 8pm
Class Six - 9pm
Class Seven - 9pm
Class Eight - 9pm
Class Nine - 9pm
If i was using the sample data above and the time was between 7pm to 8pm i would like to show only the classes which started at 7pm, or if the time was 8pm to 9pm, only show the classes which started at 8pm and the same for 9pm
I hope i have explained myself clearly, and I will be thankful for any help.
Thanks
View 4 Replies
View Related
Aug 12, 2005
Hi,
Currently I have one query that prompts the user for a beginning date, and end date of a week. It then proceeds to show the user all records in that time frame and makes a table. Now I need another query that looks at the dates the user had entered and gets all the records from the week before the user's dates. This query would also be a table query, but separate from the first one.
If anyone at all is able to help me out, I will be deeply impressed and eternally grateful! :)
Thanks,
Chris C.
View 12 Replies
View Related
Mar 29, 2008
Hi all!, i would really appriciate it if you could help me out. I have this complex query... in one table i have dates and costs associated that show when fuel was put into the system
such as:
1/1/2008 -- $200
1/20/2008 - $100
1/25/2008 - $150
I then have another table that has data when fuel was taken out of the system
such as:
1/2/2008 -- ($50)
1/3/2008 -- ($20)
1/4/2008 -- ($10)
what i need is a query that is able to show a running tab on the fuel tank and how much fuel is in it...
so for example if it could spit out a result such as
1/1/2008 -- $200
1/2/2008 -- $150
1/3/2008 -- $130
1/4/2008 -- $120
If this is convoluted i can upload a little database..
Thanks! (Here is the current query i am using but its not working right.
SELECT DatePart("yyyy",[purchase_Date]) AS AYear, DatePart("m",[Purchase_Date]) AS AMonth, DatePart("d",[Purchase_Date]) AS ADay, DSum("gallons_purchased","purchase_fuel_tbl","DatePart('d', [purchase_Date])<=" & [ADay] & " And DatePart('m',
[purchase_Date])<=" & [AMonth] & " And DatePart('yyyy',
[purchase_Date])<=" & [AYear] & "") AS RunTot, fuel_use_tbl.fuel_date, fuel_use_tbl.external_ID, fuel_use_tbl.gallons, [RunTot]-[fuel_use_tbl].[gallons] AS cur_Value
FROM (tank_tbl RIGHT JOIN purchase_fuel_tbl ON tank_tbl.tank_ID = purchase_fuel_tbl.tank_ID) LEFT JOIN fuel_use_tbl ON tank_tbl.tank_ID = fuel_use_tbl.tank_ID
GROUP BY DatePart("yyyy",[purchase_Date]), DatePart("m",[Purchase_Date]), DatePart("d",[Purchase_Date]), fuel_use_tbl.fuel_date, fuel_use_tbl.external_ID, fuel_use_tbl.gallons
ORDER BY DatePart("yyyy",[purchase_Date]), DatePart("m",[Purchase_Date]), DatePart("d",[Purchase_Date]);
View 14 Replies
View Related
Jul 10, 2013
The time difference in access query works very fine in 18:00 (Short Time) format , but when i export to excel it came out with "########" and the value is -0.14679132479
How to solve this problem , i keep trying but it doesn't work ....
View 14 Replies
View Related
Jan 23, 2014
I am trying to hardcode in the field name. This is what I want to hardcode "TEXT(ROW(A17),"-0")" but the parenthesis and quotation marks are causing a syntax error. It appears like this
IDENTITY:"TEXT(ROW(A17),"-0")"
What am I doing wrong?
View 7 Replies
View Related
Jul 11, 2012
I'm have quite a difficult time getting a form in Access 2010 to perform the way I would like it to. I have multiple tables that I've created, and a query that contains the data from the various tables. I then ran the form wizard to select the data from the query that I wanted to populate in my form and I've added 2 combo boxes.
What I want to do:
1. I want users to be able to select a category in combo box #1 (example: "Bag")
2. I want users to be able to select a detail in combo box #2 based on the category they selected in combo box #1 (example: Combo box #1, "bag" would populate the following selections for combo box #2: "sandwich" and "tool")
3. I want users to then receive a list of suppliers that provide the product they have selected, either "Bag: Sandwich" or "Bag: Tool"
I have combo box #1 populating a list of categories already. However, I am not able to get combo box #2 to provide choices based on the selection chosen for combo box #1.
View 1 Replies
View Related
Jun 10, 2005
I just started using Access a couple weeks ago. I bought a couple books, have read some help stuff in forums webwide, but I am still stuck on the basics of how to do the following~ Please Help ~
My DB:
I have a single main table, in addition there are several mini-tables used to support combo boxes for form inputing.
My Mission:
It's been requested of me that My Main Switchboard have an option to lead to a secondary form where the end-user can "quick-filter" records to generate a table or report based upon dropdowns and check boxes for 9 different search variables- the data will then be pulled from the original data table based on the 9 choices (or less, as there will be often certain variables left blank).
My Questions:
1) how do I tie the values from the combo boxes in my new form to supportive queries? (perhaps a parameter query with a macro that searches that particular combo box for values??) - or is there a better way to do this?
2) how do I tie all those queries together so that some of the 9 choices can be blank, and of the others the assurance that they'll stack- or further refine the results.
3) one of the search criteria is Industry Sector. there is a mini-table to provide the values for the drop-down, but in the main table there are four columns in case a particular company falls into more than one sector. will this present any problem or can a query be easily tailored to search any of those four columns for that value?
I want to thank anyone who cares to help very much, in advance. I know my issues probably seem very simple, but I've been tasked this duty of learning Access and working the company's DB on my own. The "comprehensive" books that I've purchased haven't seemed to clarify this particular issue, so here I am. :o
View 3 Replies
View Related
Aug 10, 2005
SELECT Table1.T1Field1, Table1.T1Field2, Table1.T1Field3
FROM Table1, Table2
WHERE (((Table1.T1Field1)=[Table2].[T2Field1])
AND ((Table1.T1Field2)=[Table2].[T2Field2])
AND ((Table1.T1Field3)=[Table2].[T2Field3]));
I took this code off another thread, and wodnered if it would work for mine.
I have two tables in the database, one is data we update monthly the other is data we get send monthly, each customer has a unique id, but not customer id's are included in the data we get sent. I need to match the customer by their id then the name and then the product group.
So firstly i want it to check the id if there is an id match then i want it to look for the product group. If there is no id i want it too look for the name then the product group. Will the code above work by doing this.
Thanks
View 2 Replies
View Related
Jan 15, 2008
I have a travel time database that should tally the number of minutes traveled and convert them into a time (hours and minutes). I, however, am having difficulty converting the numeric values cleanly. Is there anyway to convert 102 minutes + 100 minutes + 110 minutes = 312 minutes to 5 hours and 12 minutes cleanly? I need to take averages of time traveled and hours worked but cannot do this correctly. Thank you for any help in advance.:eek:
View 2 Replies
View Related
Jan 10, 2015
I have a form that contains a subform. On the main form, there are 3 fields: [IncidentNumber], [OpenDate] and [OpenTime]. The subform, [CtrlLog Detail] , contains the log entry details for each incident number. Every incident number can have many log entries. Two of the fields on the subform are [EntryDate] and [EntryTime]. The fields work correctly and the forms are fine.The issue Im having is when a new incident number is created the [OpenDate], [OpenTime] and [EntryDate], [EntryTime] MUST be equal because of some filter queries for statistics. Right now the user must physically type in the date/times in these 4 fields when they create a new incident number, which means I'm having lots of data entry errors.
Using default value on either [EntryDate] or [EntryTime] on the subform doesnt work because it doesnt create a primary key for the underlying table and the subform will not allow any other entry (due to some other linked values) until that PK is created. The forms are based on tables linked by [Activity_ID] as the primary key. I want to create some VBA code to see that if the Incident number is a new number (meaning the user must type in the new incident number creating the primary key for [Activity_ID]), that access will automatically populate the [EntryDate], [EntryTime] fields to match the [OpenDate], [OpenTime] fields on the main form. The user will manually populate the [OpenDate], [OpenTime].
If the number is an existing number (and the user is simply adding a log entry to the incident number) then I want [EntryDate], on the subform to default to the system date/time ([EntryTime] should remain blank for user entry) while keeping [OpenDate], [OpenTime] unchanged. When the [EntryDate], [EntryTime] fields are populated on creation of a new incident number, I want the PK for the underlying table ([Log_ID]) to be generated.
View 2 Replies
View Related
Jul 2, 2004
I am a self-admitted beginner so go easy . I have a query populated with
all of my data. I am building a form based on two columns in the query: Pick Up Name, and
Deliver to Name. Lets say I have records for company XYZ picking up at location A three
seperate times, location B once, and location C four times. On the form I want to have
my first combo box listing all the names of column "Pick Up Name". When I scroll down and
select company XYZ, I want my second combo box to only display the three locations where
company XYZ has picked up: A, B and C. Then I want the option of selecting either A, B or
C and in a third box, display total number of times that company XYZ has picked up at
selected location.
For example, I select company XYZ from the first drop-down. I select C from the second
drop-down, from the list of three locations. I get a result of four, because company XYZ
has delivered to location C four times.
Right now, I have my first combo box with the Pick Up Name data, where do I go from here?
Any help or nudges in the right direction greatly appreciated!
View 10 Replies
View Related
Jun 22, 2007
Mehere,
I think that you can help me with my problem, similar to the one presented here.
I have a form that, when I select an account number, I want the Group to automatically populate on the form.
Below is the code I input on the 'OnChange' event of the 'Group' field on my form:
strFilter = "OracleAccountNumber = '" & Me!OracleAccountNumber & "'"
Me!Group = DLookup("Group", "Accounts", strFilter)
OracleAccountNumber is the name of the field on my form, and it is the name of the combo box in the table that I want to lookup.
Accounts is the table where I want to lookup the OracleAccountNumber
Group is the field from the Accounts table that I want to automatically populate.
What do I have wrong?
View 1 Replies
View Related
Jul 16, 2013
I've created an array that I created and declared as a Public array in my module. I created a function that populates the array so that I can use the values in another function. I've gotten the array to populate but when I go to use the values in the array in another function, the array appears at Empty. I seem to be stuck on declaring it properly or something so that it can be used by other functions.
Public arrWebIDs As String
Public Function FillArray()
View 6 Replies
View Related