Ok, here's something I think I've done dozens of times, successfully. Now I can't get it to work.
I have a Parent Form with three Subforms (based on 3 separate, linked, tables).
I have a combo box on the parent form which looks up a piece of EQUIPMENT by its unique ID and the other two forms display equipment DETAIL and SERVICE HISTORY related to that equipment. It works just great until I use the ParentForm's navigation buttons. The two Subforms change to display the information relevant to other pieces of equipment, but the combo box continues to show the original look up.
I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.
Code:
Private Sub Manufacturer_AfterUpdate() If (Me.Manufacturer.Value = "Siemens") Then Me.Model.RowSourceType = "Table/Query" Me.Model.Recordset = "SeimensTable" Me.Model.RowSource = "SELECT Model FROM SeimensTable" Else If (Me.Manufacturer.Value = "Samsung") Then Me.Model.RowSourceType = "Table/Query" Me.Model.Recordset = "SamsungTable" Me.Model.RowSource = "SELECT Model FROM SamsungTable" End If End If End Sub
But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?
I have set up a quesry based on 2 forms 1 orders and 2 order details. i have the set a criteria on the report to print a order number
i have then set up a report based on the query. Then i have created a command button on my form up untill here it is fine the problem is when i create the order and send it to print the criterai box pops up which is ok but because i am using a touch screen it will not be viable for the user to enter the number each time he prints i would want it to pick it up from the current order id.
Is there a way to do this as i am sure all invoice systems and everything should be working like this or is there a better way to do this or am i doing something wrong i have attached a screen shot of what si going on
I'm having issues with getting UK dates to show in access.
I created a table and then undertook an insert with the following:
docmd.RunSQL "INSERT into tbl_test([dates]) VALUES (#01/06/2005#);"
Note that my machine is in UK local and the format of the field is short date. The date in access is 06/01/2005. ie 6th Jan , not 1st June as it should be
If I set up a query via the query wizard to look at this field then I see that the date is shown in US format.
I tried to use the following in the field section:
result: format(dates, "dd/mm/yyyy")
and the date still showed up at US ie 06/01/2005. argghhhh. (assume due to the fact that format returns a string and I'm looking at a date field)
I have a main form [mainform] with several subforms on it, two of which are on a tab.
On the second tab [page79] there is a subform [subformlist] which has like 25 checkboxes on it, any combonation of which can be picked by the user.
I need there to be at least one pick required of this subform, else the record won't show in a general query I have, since the table the subform is based on is linked to the record.
Is there anyway to make making a choice of one of at least one of these checkboxes checked a manditory thing before the user can close or move on to the next record?
I've tried making an "Other" box that on the Table has a default value of "True" which I thought would cause it to show in the query record...to no avail.
The only true way to make this work is to have it mandatory that the user pick from AT LEAST one, usually more before the record is complete.
Any help? Other than writing a MASSIVE If...Then statement...?
Or is there a way to make it so the choice isn't required for the record to show up in the query?
I'd post...but my db is too massive, even zipped. :(
I am trying build what I thought was a super simple data base, but this is driving me crazy.
I have a group of building maintenance manuals (12) each of which is subdivided into sections. I have created a list of all the section headings and respective page numbers and have imported them into a table (tblMASTER ) with these fields:
MasterIndexpkf SectionNumber (unique sequential number 1-311) SectionName PageNumber
I have a second table (tblCROSSREF) with these fields:
The two tables are linked in a one-to-many relationship on the respective MasterIndex fields.
I also have a query (qryMaster) which includes ALL the fields in tblMaster which serves as a lookup to the SectionName field in tblCROSSREF.
What I want to do is to select a section number in tblMaster and enter all the possible cross references in tblCROSSREF by selecting the available section names from qryMaster.
This seems to me to be sooo simple, but I am having a real headache!
My primary problem is that when I use the lookup function in the SectionName field (in tblCROSSREF) it returns not the Section Name, but the Primary Key Field number.
This thing is making me feel like the AFLAC duck. Can anyone give me a clue about where I have gone wrong?
I've been searching in vain for a solution to a relatively simple bit of mathematics that I’d like to Access to undertake.
It involves interpolating between data, as illustrated in the following example. Basically have several items, and let's say different "prices" dependent on the number of units purchased. The relationship between the “prices” is not a straightforward formula, therefore I need a query to return an interpolated price for a given number of "units".
DATA ItemID Price10Price20Price35Price50Price100Price 1000 1£70£135£200£315£800£6500 2£23£31£61£89£210£1500
OUTPUT ItemIDUnitsPrice(int) 117? 231?
So, for example if Units <10, Then Price(int) = Price10 if Units = 17, Price(int) = Price10 + (17-10)*(Price20-Price10)/(20/10) if Units = 32, Price(int) = Price20 + (32-20)*(Price35-Price20)/(35/20) if Units >1000, Then Price(int) = Price1000
I'm aware that IIF statements might do the job, but I have 15 different 'Price' points, and don't particularly want to nest them all.
This problem was solved previously in Excel using a clumsy set of VLOOKUP/HLOOKUP functions in conjunction with If statements.
I got a headache to changing my form's filename... i am totally a newbie in Access while in the few months ago... so i just create all those form or table name's for the way i like. But now i had already know how important of management of the filename because when u r using the module to write the code u will be headache to look for the filename that u want in the code. So that is important to add 'tbl', 'frm', 'Qry' infront of the filename.
So do anyone have a good way to edit all the file name with all match to the other in the module with a quick way rather then one by one editing (really tired for one by one) Thanks!!!
I need some help. My brain just can't grasp how to do this.
I have an Access DB. I sell vinyl records. I have an order form. When a customer orders a record, each vinyl record has a unique ID#. No two vinyl records are alike. I have four tables: Customers, Orders, Inventory, & Order Details. I have an "Order Form" form where I input all the info. It's an all-in-one form where you can view and data entry in one screen. The form has two subforms in it. Here's the problem: If a customer orders more than one item (i.e. a vinyl record), each Inventory_ID (representing one vinyl record) is associated with one Order_ID which is, in turn, related to one Customer_ID. If I have one Order_ID that has multiple Inventory_IDs (i.e. has ordered two or more vinyl records) that belongs to one customer, how can I calculate that total cost? Currently, I have a calculated field within my all-in-one form that calculates only the price of the Inventory_ID that one currently sees on the subform. The Inventory_ID item has a set price, for instance $5.00. If I scroll through the ordered Inventory_IDs, the calculated field will only display the price of the product that you currently see. It's not really calculating anything, I guess. It's just bound to that field, but I need to sum up all the price fields for all the Inventory_IDs that are associated with one Order_ID & Customer_ID whether it's a query or calculated field...I just need it done so that it'll display on this form. Any help would be much appreciated. I can show you whatever you need to see. Thanks in advance. David
I want to 'append' individual records from 2 tables and place in an archive table or within another database, whichever is the best option. I then want to be able to 'delete' the relevant records from one table.
The tables are tproperty and trents. This property paid rents but has since been sold. Therefore it no longer belongs in the database, however client wishes to keep details of the property/person/and rents paid in past, for any future ref. These tables are linked in relationships to tlessee and tbilling. I've read books/notes/looked on here for inspiration and the right direction! If I choose 'append' which seems pretty straight forward then a 'delete' query, how do I choose only one record? Is a make-table onto a different database a better option? It would appear that the whole table is copied over? Can't understand the issue about auto-numbers being copied over? Do I have to use an append/delete query for each individual property that's ever removed? I'm at a loss! :) Thanks
I have a form that contains 2 combo boxes, one that lists the Wards in the Area and the other contains the types of groups. I can generate a report listing a specific group in the Ward but need to be able to list a specific group in every Ward. I have added "All" to the Ward combo box along with the code in the row query
SELECT [tblWards].[WardID], [tblWards].[Ward] FROM [tblWards] UNION Select 0 ,"All Wards" From [tblWards] ORDER BY [Ward];
When select all Wards from the Combo box and run the report I get no results.
I have form containing 8 comboboxes. On click on command button i want to set the item/caption/selection of combobox. How should I do that? Button has OnClick event built in VBA. What would be the code?
On my main form I have a subform which holds two table values. [Roles] & [TrainLevel] example of this looks like this:
Plant Manager - T1 Assistant - T2
and so on for about 12 rows with different roles, each with different training levels.
This subform is then based on a query: [qryRoleEventWithRoles] which also looks at all the other selections, selected on the main form.
eg. User selects a training course on the main form, this then changes the subform and shows what level of training each role requires training in, T1, T2 etc..
All this has been working fine for months, almost a year. Each selection on the subform is based on using two combo boxes [Role] & [TrainingLevel] these are both setup on the subform and using the autonumber field, RolesID and TraininglevelID from two separate tables.
Like I say, this has been working fine. Now, all of a sudden, they've stopped working and telling me I can't change the valve because there bound to an autonumber value. or something like that.
Row Source Type = Value List RowSource = 1;test1;2;test2;3;test3;4;test4;5;test5;6;test6;7; test7;8;test8;9;test9;10;test10;11;test11;12;test1 2 ColumnCount = 2 ColumnWidths = "0cm;8cm" Bound Column = 1
For some reason unknown to me, although the combobox does drop down when entered, the values are not visible until selected, then the selected item is visible in the combobox, but still isn't visible in the drop-down list.
i have 2 tables (clients, frequencies) where in table "clients" i have a column to store ID of "frequencies" table (id, description).
in my form "FClient" i display data stored in table "clients" and i have a combobox that should display the "frequencies" descriptions, but with a frequency selected by default...in fact the one that has its ID stored in table "clients". i'm able to display all frequencies descriptions but i don't know how to easily select and then display, as default, the frequency stored in table "client"
I'm trying to filter the options in a combo box based on two criteria. The first criterion is another combo box on the same form, for a cascading combo effect. This criterion works fine, no problems at all. The second criterion is a query. So the combo box should display only those values that match both the upstream combobox AND the results of the query. What's really frustrating is that this combobox works just fine in my development dbase. It only stops working when I move it into my active dbase. Anyway, here's the SQL for the combobox rowsource:
SELECT DISTINCT Size2.SizeID, Size2.XYdim FROM (Shapes INNER JOIN (qrySignsInInventory INNER JOIN Size2 ON qrySignsInInventory.SizeID = Size2.SizeID) ON Shapes.ShapeID = Size2.ShapeID) INNER JOIN Signs ON Shapes.ShapeID = Signs.ShapeID WHERE (((Size2.SizeID)=[qrySignsInInventory].[SizeID]) AND ((Size2.ShapeID)=(SELECT Signs.ShapeID FROM Signs WHERE Signs.SignID = [Forms]![frmUsedDropdown]![cmbSignID])));
I've hilighted the criterion that isn't working. Also, I'm not getting any errors or anything, it's just that the results aren't being filtered. I've triple-checked the references for the active dbase, and I've checked the results of the query. Everything should be working.
So I have a Form (frmPositions) with a subform attached (fsubPosSkill).They are linked through Position ID frmPositions Record Source is qryPositionNeeds
Code: SELECT tblPositionNeeds.PositionNeedsID, tblPositionNeeds.PositionID, tblPositions.Position, tblPositionNeeds.NeedsID, tblNeeds.NeedStatus FROM tblPositions INNER JOIN (tblNeeds INNER JOIN tblPositionNeeds ON tblNeeds.NeedID = tblPositionNeeds.NeedsID) ON tblPositions.PositionID = tblPositionNeeds.PositionID;
It has two texts boxes on it [PositionID] and [NeedID]
I have a form (named Example) to create reports by selecting fields from tables or queries. there is a option box (name is KynkSec) with two options (Table, Query) and a combobox named as KynkTurSec.I want to change the data source of combobox either table or query. By afterupdate, that combobox is requering the listbox "ListKynkAlan" and I can see fields of selected table or query. (That is my dream))Unfortunately I can not do that. Combobox is showing only tables or both of tables and queries. But not only query.
Here is str source of my combobox:
SELECT MsysObjects.Name, MsysObjects.Type FROM MsysObjects WHERE (((MsysObjects.Type)=1) AND ((Left$([Name],1))<>"~") AND ((Left$([Name],4))<>"Msys")) OR (((MsysObjects.Type)=5) AND ((Left$([Name],1))<>"~") AND ((Left$([Name],4))<>"Msys")) ORDER BY MsysObjects.Name; That is showing both of tables and queries.
And I wrote a code for KynkSec option box;
Private Sub KynkSec_AfterUpdate() ' Populate rowsource of KynkTurSec Dim strSQL As String On Error GoTo HandleErr Select Case KynkTurSec
Case 1
strSQL = "SELECT MsysObjects.Name FROM MsysObjects" _ & WHERE(((Left$([Name], 1)) <> "~") And ((MsysObjects.Type) = 1) And ((Left$([Name], 4)) <> "Msys")) Order BY(MsysObjects.Name)
Case 2
strSQL = "SELECT MsysObjects.Name FROM MsysObjects" _ & WHERE(((Left$([Name], 1)) <> "~") And ((MsysObjects.Type) = 5) And ((Left$([Name], 4)) <> "Msys")) Order BY(MsysObjects.Name) Case Else End Select
[code]...
But this code is not working and giving a warning messsage "Sub or function is not defined"..So How can I change the source of combobox, either table or Query?
I have a combobox which lets you select from a list of pseudonyms. Each pseud belongs to an author; authors can have multiple pseudonyms and exactly one main pseudonym. This is the table structure (picture of relationships attached below):
The combobox list shows all the pseudonyms and then stores the corresponding AuthorID. At the moment, the pseudonym displayed in the combobox (once a selection has been made) is simply the first alphabetically for that particular author: for instance, if a story has AuthorID = 5, and Author 5 goes by anon, anonymous, and unknown, the combobox for that story will display "anon".
How can I make the main pseudonym (tblAuthor.MainPseudID = tblPseud.PseudID) be displayed instead?
Control source is tblStory.AuthorID
Row source:
Code: SELECT tblPseud.AuthorID, tblPseud.Pseud, tblAuthor.MainPseudID FROM (tblAuthor LEFT JOIN tblPseud ON tblAuthor.AuthorID = tblPseud.AuthorID) LEFT JOIN tblStory ON tblAuthor.AuthorID = tblStory.AuthorID ORDER BY tblPseud.Pseud;
User pick a record from a list and are able to doubleclick that record which will open another form with that record's ID. If the field is Null, then another form opens allowing the user to create a new record. The part that doesn't work, is if that record that was in the combo, gets deleted from somewhere else. Then the ID is still being shown in the combo (that's OK but it's no longer null), so double clicking the field does not bring up the correct Create New record form.
What I would like to have is something similar to the NotInList message that states something like, "That record has been deleted". This is what I have so far,If not in list
Code:
Private Sub APID_NotInList(NewData As String, Response As Integer) MsgBox "Please select an ... or double-click this field to add a new entry to the list." Response = acDataErrContinue APID = Null End Sub
On double clicking the combo
Code: Private Sub APID_DblClick(Cancel As Integer) Dim stDocName As String Dim stLinkCriteria As String
I have a form based on a table with just sales quotes and dates. I am using the salesquote as a combo box to select corresponding records in a subform.
Code: Private Sub cboSalesquote_AfterUpdate() Me.Filter = "[salesquote]=" & cboSalesquote Me.FilterOn = True End Sub
Works fine. But not the mgr says his users get confused when they are making changes in the subform which record they are changing so they want when they select a record from the combo box and the records appear in the subform; they want the combo box to go blank. I am not sure how to do this because if I reset the combo box to go blank; the subform records will go blank as well.
I have a requirement that will need three cascading combo boxes - the second box should only display the contents that match or are relevant to the first combo box, etc.The title of the YouTube video is:
Microsoft Access pt 9 (Cascade Combo Box)
It seems the first and second combo boxes cascade and works fine. However, the third combo box remains blank after the second combobox selection has been made.
I have three tables: Customer, CustomerSubOrg, and PORs. I have setup lookup fields that are using Primary keys for two of the tables (CustomerSubOrg and PORs). However, I ensured that the primary key fields display as the "Names" of each instead of the numbers. I also ensured I went back and changed their data type to "Text" instead of "Number" so the text appears (which seems to have worked for box #2).
How to get the third combobox to display its contents? I've attached some additional screen shots below. I know the problem is within the second combobox -- perhaps the query needs some adjustment?Unfortunately I cannot attach images yet since I am now. But I basically created two queries and used them each for the second and third combobox.The comboboxes on the form:
Customer Sub Organization POR
The Suborg query looks like this:
Table: CustomerSubOrg First Column: From field SubOrg From table CustomerSubOrg
Second Column: From field CustomerID From table CustomerSubOrg Criteria [Forms]![frmMain]![cboCustomer]
The POR query looks like this:
Table: PORs
First Column: From field PORName From table PORs
Second Column: From field SubOrgID From table PORs Criteria: [Forms]![frmMain]![cboSubOrganization]
Why wont the contents from the third combobox appear?
I'm working on a db that will track students for a summer camp. One of my fields in my student records (CamperInfo) is "School". Currently, the field is set up as a combobox in the CamperInfo Subform in the FamilyInfo form. I would like the combobox to be able to add schools if the school is not listed by a pop-up when the "add school" (or whatever) is selected.
Code:
Private Sub School_AfterUpdate() On Error GoTo Err_School_AfterUpdate Dim strForm As String If Me.School = "Schools" = True Then strForm = "Schools" DoCmd.OpenForm Me.School Err_School_AfterUpdate: MsgBox Err.Description End If End Sub
As you might have guessed, it doesn't work. no errors, it just doesn't do anything. I added the "Schools" data.
I have a main form that identifies a Client File: frmClientFile (Single Form)
On the main form is a subform for Cases: subfrmCases (Continuous form)
Also on the main form below the Cases subform is a tab control that contains additional subforms to view/update different aspects of a case: subfrmCaseClients (Continuous Form).
The way this operates is that the user first chooses a file using a combobox on frmClientFile.
The subfrmCases is linked to the main form (using the caseFileID) and filters correctly.
The subfrmCaseClients is then linked using some hidden text fields on the main form (using caseFileID, CaseID) and this filters correctly.
On subfrmCaseClients is a combobox (cboClientID) that I need to requery based upon the Case Row selected on subfrmCases.
I have tried numerous combinations of options to force the requery by trying to apply a macro on the following:
OnCurrent, OnSelectionChange, OnChange and AfterUpdate events to no avail.
If I hit F5 to refresh the entire page the combo box gets updated as expected.
How do I get the Requery to work programatically? Is this even possible?
I am trying to use a combo box to refresh a subform. I am working with Access 2007 as my front end and SQL 2014 on the back end. On my main form called frmDealers I have an unbound combobox where the user selects a dealer and then text boxes are populated with address and phone number. I have it unbound because I don't want the user to make changes to the dealership at this point. On the subform I have people that work at the dealership. That form is called sfrmDealerContacts. The subform could have multiple contacts for each dealership. The subform is bound to a query called qryDealerContacts. I have it bound to a query because I want email hyperlinks in the table too. I tried searching the forum and found this thread number 279791.
After searching I added:
Form_sfrmDealerContacts.Form.RecordSource = "SELECT * FROM dbo_DealerContact WHERE DealerID = " & Me![cboDealerName].Column(1)
But this brings up an input box so I must have something wrong. My code is: