General :: Determining The Values In One List Based On Another
Jun 27, 2012
I have a table with a few Listbox options. I want one of the columns' values to be determined by the value chosen in another field. How do I do this?
Example: In column A I choose value ABC from the dropdown. I want column B to now offer values in that list of DEF, GHI, JKL. If I chose XYZ in column A instead, I'd want the column B list to show MNO, PQR, STU. Etc.
In my form's table (tblMain), I've got a lookup field (drop-down list) that lists the primary key field from a different table (tblDiff). tblDiff includes 3 more fields. In my form for tblMain, I want to include 3 more textboxes that get filled up with these 3 fields from tblDiff when the corresponding primary key is selected in the drop-down box.
I have a master data table containing 4 columns and ~ 500K rows. I have a list of keyterms from column1, column2 and column3. How do I use Access to search the masta data table and return the corresponding column4 value for each row on the list.
In Table Quotation when i select product name from dropdown menu i want all the related information for that product to be visible in Quotation like product id, productdescription & productcost
I have an AfterUpdate event where I want a list box to be populated based on three different criteria based on a table in my database
1. Complete = False AND 2. Supplier on form = supplier in table AND 3. Status in table = "SUPPLIER_RFQ FOLLOW-UP" OR "SUPPLIER_RE-RFQ TO OTHER SUPPLIER"
I am having trouble with the last OR statement criteria, i cannot get this to return values correctly. Here is my code:
Below is a sample of the table with the data. I manually added the 1 and 0 to the hc_Year field. However, I would like to create an Update query that will add a 1 to the hc_Year if its the first instance of PIDM & regsYear and add a 0 to the records that are not the first instance.
I could have many periods in a future. What i want is to allow users to insert just first start year and lenght of period and table will be automatically updated based on these two values.
So user will insert Period_Start_Year and Length of Period, for example 2010 and 2 and table should be>
While i am writing this i realised that user have to specify also ending year, i do not want to have infinity.. I am thinking about form and update query but can't get it...
I have an access database in which I have a table A and table B. Table A has a list of 200 website URLs. Table B has one column ID and another criteria.
I want to create a query to filter websites list which does not have values or characters from table b.
I have these values in table B that I want to be filtered out or not shown in my URL Select Query
.org .gov .du .pk .dk
I would keep on adding more criteria into this so criteria table so adding new criteria into table B should not disturb our filtering.
SELECT tableA.WEB_ADDRESS FROM tableA WHERE ((([tableA].[wEB_ADDRESS] Not Like '*'+(SELECT * FROM tableB)+'*')=True));
I've setup a selection form that returns a specific list of email addresses in a query.
What I can't work out is how to press a button and have the email addresses populate the To: field in a blank Outlook email - I don't need any bells or whistles.
I'm using Access 2010. I need to calculate a score based on values selected in a table by looking up corresponding values in other tables. I have a "Project" form to create new entries into the Project table (see Table 1). When I create a new project record, I will select values for the Payback and Need fields by selecting options from a list. The Payback list is pointed at Table 2 and the Need list is pointed at Table 3. In the below example, I created the "ABC" project and selected "1 year" for the Payback field and "Repair" for the Need field. Pretty simple.
Now that I have the "ABC" project loaded to my Project table, I'd like to create a report that will show a "score" for this project. The score should be calculated as follows: Payback Impact + Need Impact. In this example, the score should be 30 (Payback Impact of 20 + Need Impact of 10).
I'd like to create a query which will consist of simple SELECT statements as follows:
SELECT [table1].[field1], [table2].[field1], [table2].[field2] FROM table1 INNER JOIN table2 ON ([table1].[fieldX] = [table2].[fieldX]);
The challenge arises b/c instead of joining on equal values, such as the following: [table1] INNER JOIN [table2] ON [table1].[field1] = [table2].[field1]
I would like to join based on equivalencies, such as: [table1] INNER JOIN [table2] ON [table1].[field1] = 34 is equivalent to [table2].[field1] = 2;
I do not know the proper syntax, so this is where I need help. I tried to search online without any success.
I have an .adp file but I'm not sure which tables/mdb file(s) are used. Any easy way to determine this? I'm backward engineering because someone got fired. Any help would be appreciated.
Working on a calendar project. I've found some helpful code, but I don't want to use someone elses whole project. So while trying to understand how all this works I'm running into some problems. I am using to start one of the simpliest codes I have found. ``````````````````````````````` Private Function filldates()
Dim curday As Variant, curbox As Integer, Tbox As Variant
curday = DateSerial(Year(Me![FirstDate]), Month(Me![FirstDate]), 1) 'first day of month curday = DateAdd("d", 1 - Weekday(curday), curday) 'back to sunday For curbox = 0 To 36 'need to loop thru 36 textboxes Me("D" & curbox) = Day(curday) Me("D" & curbox).Visible = False Me("T" & curbox).Visible = False If Month(curday) = Month(Me!FirstDate) Then Me("D" & curbox).Visible = True If Month(curday) = Month(Me!FirstDate) Then Me("T" & curbox).Visible = True curday = curday + 1 'nextday
Next curbox
End Function ``````````````````````````````````````` 'Note' I have added the "T" box for additional info.....
My problem is this...... I have 36 boxes that can contain variable dates. What I want to do is on the "Click" or "DoubleClick" event of say...... box "T14" I need to determine what date is the current value of "T14" and then I can open the other form to that date. This other form would be details of whatever date is currently in "T14" Does that make sense???? Hope so! :) Any thoughts??
I have an ASP / Access storefront, connecting through JET OLE, which is frequently crashing with '800040005 System Resource Exceeded'. The whole ODBC/Jet service must be restarted by my host manually.
Usually this error indicates an unclosed rs.open. I have however triple checked all code and there are no unclosed loops.
I am examining the basic connection variables and wondering if perhaps as my database has grown over the last year, the following original 'out of the box' settings are no longer suitable, and causing this error.. in particular maybe the 'Const MaxRecords' is no longer enough (or is too many?). How does one calculate what these Const settings should be?
Anyone know of a way in Access/VB to determine what the region/location is set to on a user's computer? Need to determine whether to use commas or decimals as a monetary separator.
I've been stumped for the past couple of days trying to discern a method for a form to determine that it's a new month and run a procedure and only run it on month change.
My initial thought is:
Open recordset move to the last record compare the month in a date field within the last record to the current month and run the procedure if the month is different.
I can't get this to work however and I'm not sure what I'm doing wrong. To be honest I typically fumble my way through VBA when it comes to opening recordsets. Here's what I got:
Code: Dim rs As DAO.Recordset Dim db as CurrentDB Dim strSQL As String Set rs = CurrentDB.OpenRecordset("FlightLog") strSQL = SELECT [txtDate] FROM [FlightLog]
[Code] ....
txtReqNumb and txtFltNumb are the values to be reset at the beginning of each month.
Am I on the right track and just have the VBA wrong?
I am trying to position opened forms so that they are cascaded on the screen. I have discovered the movesize action (for the DoCmd) and Move property of a form (for Acc 2002/2003). However, if the application is opened up on different monitors (e.g.; 17" or 19"), the relative location of the opened form is not the same (i.e.; on the bigger monitor the opened form is too far over to the right and too high).
What I want to do is ...
When the subsequent (or second) form is opened up I would like to find the absolute location of the first form (always centered). This way I will be able to reposition the second and third forms relative to the first form.
Is this possible?
I'm having trouble referencing the first form from within the second form. The first form is still open, but they are not linked forms (not parent/child). I've tried:
I have two related forms.One is a list of transactions and the other is used for both inquiry and adding new transactions. If the Inquiry form is just sitting in Add mode and the List form tries to open it in Edit mode, it won't open. Is there a way I can tell from the List form that the Inquiry form is in Add mode and either close it or tell the operator about the issue?
We have a database that is split. Every user has their own front end (installed via a .bat file so that the users always have a local copy of the most recent version), linked to a shared back end on a server. This seems stable and functional for us so far.
However, because our users are geographically separated, I don't actually know how many folks are using the database. I know the folks who contact me, but everyone in our company could use it if they wanted to.
For requesting funding, guiding future development, etc., I need to get some metrics:
Total number of unique users Avg uses per day
Total number of simultaneous users (daily, weekly, and monthly maxes and mins)
What is the best way to get this info? Write user info and a timestamp to a table each time a front end is launched? Are there tools for monitoring this sort of information?
I want to run an external application (a batch file) ... and want to run it by clicking on a command button on a form. That part is all fine, using the Shell command. I can determine the start time of the application (also fine with now() function) .. but want to find out how long the external application ran and log that "run time" into my database.
The part I don't know about is the .. really the ending time. How do I determine how long the application really ran for / ended ? I imagine I can use datepart to determine the difference in the start and end times. Or would I use a timer control. (but I cannot find the timer control in Access 2010).
I m new to access, i want to get the Project_name into "form!project_name " from the project table when user select project_id in the form. Any idea will be appreciated.