I have about 10 columns with data in each column...the columns dont need to show every time. I want to set it up where the user pics the column heading from a drop-down menu and then that column alone will show, none of the other columns are visible...can this be done?
When I attempt to use the me.field = me.combobox.column() method to retrieve info from another query,it only works if I use column 0 or 1... it doesn't work with higher columns number.
- field name: cbofi - row source: listado-unico-fi <-- it is a query with unique values and 7 fields in total - event procedure, change:
Private Sub cbofi_Change() Me.txtDOCTPT = Me.cboFI.Column(1) Me.campovia = Me.cboFI.Column(5) End Sub
- txtDOCTPT is the field that indeed works - campovia is the one that does not work
I tried using column(0) and column(1) and it worked fine... but higher column numbers do not work. Just mentioning because the field names are all right.
I am trying to run a simple update query to copy data from one column (Addrl1)to another column (Working_Addrl1) within the same file and I can't for the life of me figure it out. Then I need to repeat for addrl2 and addrl3 to working_addrl2 and working_addrl3.
I have created a cross tab to extract pipeline and sales for Q1 2014, Q2 2014, Q3 2014 & Q4 2014... the user can select the quater from a multivalued text box...
Now for the final output, have created another query which pull the above four quarter in each column from the cross tab...now the problem arises when i change the quarter to Q2 2014, Q3 2014, Q4 2014 & Q1 2014..it gives an error "Microsoft office Access database does not recognizes "Query name" as a valid field name or expression".
The error is because the second layer of query does not identifies Q1 2014.
How do i make access change the column automatically when the Q1 changes to Q2...
I have a form that shows multiple rows of linked/child records.The form in question is the "frmFilterNumberTypeView" form. When a particular filter is used (installed on an automobile), I would like to be able to click on the corresponding "Installed 1" button left of the filter number, so that by code, I can reduce the Qty on Hand by One, and insert the corresponding filter ID to the History table, along with the date/time the filter was used.
how to reduce the Qty on Hand, nor how to do the updates to the History table, I'll figure that out myself over the next week or two (hopefully it won't take that long). What I'm trying to figure out here is how I can associate the red "Installed 1" button with the filter to the right of whichever button I press.
how to sort the filter column on this same form. I'm fairly certain that this would be very easy to do if the subform in question was populated by means of a corresponding query, but I'm afraid that if I go that route that I'll spend another 20+ hours trying to figure out how to get the proper filter records to match the filter manufacturer, not to mention having to next figure out how to link the table so that if I modify any particular filter record, that I'll be able to have the associated table update accordingly.
Is it possible to sort the filter column without the subform record source being a query?
I am looking to add a column in a query that will give a Y or No to previous column data if it contains TEXT or NUMBER (It could read "TEXT" or "NUMBER" or even Y for text or N for number).
I have a database of spare parts and I want to calculate the price of the whole warehouse.I have managed to do [quantity]*[price] in a subform but now I want to sum all and show the result in textbox.
I've created a form with a combo box to allow users to set the Manager of an employee. I've set the control source for the combo box to the Managers table that contains a primary key and the manager's name.
I've set the bound column to 1, the column count to 2, the column widths to 1;2 (I want to show both columns in the drop down because users can identify managers by either their name or Manager ID).After updating the combo box, the Manager ID shows rather than the Manager Name. Is there a way to have the Manager name show instead of the Manager ID without setting the column widths to 0;2?
my requirement was for a control in a subform and I needed all this to affect a first column freeze.The code was in the Onload for the main form.
Code:
Dim ctl As Control Set ctl = Forms("frmPlanner").Controls("subfrmTempCtrl") Me.SetFocus ctl.SetFocus ctl.Form.Controls(0).SetFocus DoCmd.RunCommand acCmdFreezeColumn
It does work but I can't fathom why I need more than the last .SetFocus. Leave any of the prior ones out and it gives an error to the effect that can't do it in those circumstances. I understand the control has to have focus for it to work but why are the other's required?
I have a form with a subform. The subform is a continuous form with two controls, both textboxes. The value in the second box is looked up in a table, where the column name is the value from the first box.
I tried a lot already, this code seems to work but only for the first value of the continuous form and is not refreshed when I click next record on the parent form:
Code: Private Sub Form_Load() 'get the value from the first textbox strLabelName = Me.LabelName.Value 'get the ProductID needed for WHERE clause from parent form strProductID = Me.Parent.ProductID 'use dlookup strLabelValue = DLookup(strLabelName, "tblProducts", "[ProductID] = " & strProductID) 'place the returned value in the second textbox Me.Text5.Value = strLabelValue End Sub
Is it possible what I want and how may I establish this?
I have some code for the Key Down event for particular column in my subform
Private Sub Sample_ID_KeyDown(KeyCode As Integer, Shift As Integer) Sample_ID = Nz(DMax("Sample_ID", "Sample_Sheets")) + 1 mTo = Nz(DMax("mTo", "Sample_Sheets")) + 1 mFrom = Nz(DMax("mFrom", "Sample_Sheets")) End Sub
This works, however it also work when I press Key Up, changing what the key down previously did. I do not want it to do this. I have nothing entered in the Key up event for the form properties.
I am having a problem entering the 2nd column of a combo box.This is a lookup combo looking at a table called Accessories. The combo is looking up 4 columns in the table, the first column is called "Action" the 2nd column is called "Item". I click on the combo box in the form and decide on the action I want and click that row, it then enters the action I have clicked. But it is the "Item" column I want to enter on the form not the "Action" column.
This only works if I make "Item" the first column which I do not want to do. I want to keep the combo columns in the order they are but enter the 2nd column not the first. I have tried making the bound column the 2nd column but it still enters the 1st column. I am sure access must be capable of doing this but I cannot work out how. It seems you can only enter whatever is in the 1st column.
I have a combobox (cbo_Breed) that Holds the Breed_ID, Breed and BreedType_ID.
On the form opening I want to look at the thrird column and if its a "1" then to do something. How do I get the form to look at the third column? This is what I have written (I know its wrong, but needed a starting point)
I was wondering if a list box can be made so the header of each columns is clickable.. so you can sort by that column either alphabetically or numerically?
I have a form that has a combo box (box1), Its row source is from a table (table1) than the forms record source (query1). The data box1 sources is from column1 in table1.
I then have a text box (box2). I need it so when i select a record in box1 (from column1) that it displays the corresponding data in that same record (and table) but from column2
Example:
A table has a column with equations and another column with the answer.
I select "1+1" in the combo box Then in the text box it displays "2"
In short, I have a form that has a combo box containing people type values. Then two text entry boxes, firstname, lastname. Then an add, update, and delete button...
When the person type is chosen from the cbo, and the names are filled out, and the 'add' button pressed a query sends the values back via sql insert, and a listbox next to these controls then lists the new person records. Great - No worries...
Then, when someone wants to update the record now shown in the listbox, on double click of the record in the listbox, vba repopulates the name text boxes from the listbox's columns values (easy), and then *magically* the person type combo box chooses amongst its values the value stored in the person type column from the listbox.
I can't get the combo box to be set to the value that I am grabbing from the listbox's column values.
Part of me wonders if I would have to program in a way to search among the combo boxes values and find out which one was selected from the listbox, find it's index value and then set the combo box to be that index/value record... but that seems like a hard way to do it... and I'm not exactly sure how?
I have form with these info : customer (Table), EnterDate (Button) and customersub (subform), i want to enter date into Date column using form with button.
example
ID name sample date 1. John A .... 2. Michel B .... 3. Jack C .....
into like this
ID name sample date 1. John A 2/2/2014 2. Michel B 2/2/2014 3. Jack C 2/2/2014
I try this this sql. but the date only insert/update for avery row i was select.
Q: How i can make sure i put one date.. it will insert for every row just one click.
Private Sub EnterDate_Click() CurrentDb.Execute "UPDATE Customer " & _ "SET Date='" & Me.insertdate & "'" & _ "WHERE ID= " & Me.Costumersub.Form.Recordset.Fields("ID") End Sub
This is the function i'm using for summing a listbox column:
Function TonSum() As Variant Dim I As Integer, J As Integer, ctl As Control Set ctl = Me.lstDrivera2 J = ctl.ListCount - 1
[code]...
The problem i have is if one the records in the listbox doesn't have a value (is null) then Access gives me a 'Type Mismatch' error. How to treat the null value so it excludes it from the sum?
I have a text box that is displaying a value from a table where the display control for the field in the table is a two row combo box. The text box on my form (I'm droping the text box on the form and manually changing the control source) is displaying the second column of the combobox where as I want the first column. If I drag the combobox from the field list onto the form it does show the expected first column (now if i change this to a text box in properties it shows the second column as well). Is there a way to change the text box to view the first column?
i create a project for salary company , i have a list box and have 6 columns & i have 1 textbox , i work with code and a listbox is the query know i need the value of textbox is equal with the column 1 from listbox how to do it ? like when i run form need to be enter the code when entered the code in listbox is equaled with the textbox .another question , in the list box i have one column it is about salary i want the total of salary.
Why Access 2010 does not save the Datasheet order?? I keep setting the order and it puts it back again
I have set the order in the design. I have set the tab index individually for each item. I says in the tab order that they are in the correct order. I reorder them in the datasheet and click on save. Nothing sets that order. It will revert it back to the order that IT wants every time.