Modules & VBA :: Remove Column From Form?
Feb 23, 2015
I have a multiple record form that displays fine. However, on the left hand side there is a column that when a record is selected, an arrow appears there. I don't know what this is called in order to suppress it.
View Replies
ADVERTISEMENT
Jun 27, 2013
So I have been developing a database tool that needs to have multiple ways of filtering data. I wanted to be able to display the data nicely so I'm using a split form.
As usual, there is an easy to read form on the top half and a datasheet on the bottom half. On one side of the form half I have some comboboxes that are associated with fields in the datasheet. The comboboxes apply multiple filters, narrowing the search results down. It all works fine.
However, I've been trying to figure out a way to remove just one filter at a time. There is a button to the right of each combobox that is intended to clear just one filter.
So far this is what I have. This code clears all filters.
Code:
Function removeFilter(source As String, combo As ComboBox)
'source is the field being filtered and combo is the current
'value of the combobox
With Forms("PART_QUERY")
.Filter = "[" & source & "] = " & Chr(34) & combo & Chr(34)
.FilterOn = False
End With
End Function
I had some success using another method with select statements. Every time I cleared a filter, I would also check every other combobox to see if they were not null, then reapply each one of there filters. That seems way over complicated. I'm sure I'm missing something.
How do I remove one, specific filter from a split form, after I have applied many different filters?
View 4 Replies
View Related
May 14, 2015
I have a query that displays this
Column1 Column 2 Column 3 Column 4
TripTitleA TravelerA N/A N/A
TripTItleB TravelerB N/A N/A
TripTitleC TravelerC TravelerD TravelerE
TripTitleC TravelerD TravelerC TravelerE
TripTItleC TravelerE TravelerC TravelerD
TripTitleD TravelerF N/A N/A
I want to filter Column1 to have no duplicates so it looks like this
Column1 Column 2 Column 3 Column 4
TripTitleA TravelerA N/A N/A
TripTItleB TravelerB N/A N/A
TripTitleC TravelerC TravelerD TravelerE
TripTitleD TravelerF N/A N/A
Is this possible?
View 1 Replies
View Related
Nov 30, 2014
I need to input a string into a column named "EventType". The code should first check if the column "Agent Name" contains any strings. If there is none, it will input "IBM Director" into the EventType column.
Once it has looped through the agent names, the code will then loop through the Details column and input into EventTypes based on what is displayed within the string.
These are the codes that I am using to achieve this, however nothing is being input into the EventType column.
Code:
Private Sub Command11_Click()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Final")
[Code] ....
I think the problem lies with the code that checks the agent name. When I removed it, it managed to populate the EventType column based on the details. But I still need to find out how to check the agent name too.
View 4 Replies
View Related
Apr 5, 2015
I have 1 combo box and 1 text box i look up 2 columns in the combo box from that combo box i want to look up 2 column to text box
example:
Table values:
Col 1 Col 2
A 1
A 2
combo box successfully look up 2 columns but i look up to text box
Formula: =combo1.column(1)
But the text box look up the first row always even i choose the second row A
Also look-up first row 1
Any solution to look up 2nd row?
View 3 Replies
View Related
Nov 7, 2013
I'm trying to update all the rows in a column (column A, PO Number) within a table (iSupplierTable). The value (txtPONbr) is entered by the user on a form (NewPO).
Code:
Private Sub cmdSubmit_Click()
On Error GoTo cmdSubmit_Click_Error
Dim db As Database
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = "iSupplierTable"
[code]....
View 9 Replies
View Related
Feb 28, 2014
I want to convert a number column into a text column.
Number Column is called Customer.
Below I can't match to the other table containing the text column Customer No.
How can I convert columns in vba?
Code:
strSQL = "SELECT CALCULATED_Forecast_TNS.*, USEFUL.TRP_in_EUR " & _
" FROM USEFUL INNER JOIN CALCULATED_Forecast_TNS ON (CALCULATED_Forecast_TNS.[Reference No] = USEFUL.[Reference No]) AND (USEFUL.[Customer] = CALCULATED_Forecast_TNS.[Customer NO])"
Set qdf = CurrentDb.CreateQueryDef("REPLACABLES", strSQL)
DoCmd.RunSQL "UPDATE REPLACABLES SET CALCULATED_Forecast_TNS.TRP_in_EUR = USEFUL.TRP_in_EUR"
View 1 Replies
View Related
Feb 2, 2015
I am using .FormFields to fill a quotation template in Word, but the subform I am retrieving the data from has rows of records under each column and I need to send more than just the first row to fill the required bookmarks in Word.
The code I'm using is
Set doc = appWord.Documents.Open("S:TemplatesQuotation Template - Test.doc", , True)
With doc
.FormFields("FirstName").Result = Me!FirstName
.FormFields("FirstName2").Result = Me!FirstName
.FormFields("LastName").Result = Me!LastName
.FormFields("LastName2").Result = Me!LastName
[Code] ......
View 4 Replies
View Related
Apr 16, 2015
DoCmd.RunSQL (" update tbl_userinformation SET [05-Henrichpiramid] = Yes where Username= Text146.value AND actualdate=Text148.value ;")
DoCmd.RunSQL (" update tbl_userinformation SET [combination] = [05-Henrichpiramid] where Username= Text146.value AND actualdate=Text148.value ;")
i want to update the column combination to its last value with concatanation to the value of current column.
View 11 Replies
View Related
Sep 18, 2013
I have a table that contains:
item | quantity
123 | 1
456 | 10
789 | 4
I need to get this data listed into a table that just has item and for it to look like this:
123
456
456
456
456
456
456
456
456
456
456
789
789
789
789
I understand and have accounted for the obvious primary key issue.how to get the data to display out like this.
View 1 Replies
View Related
Aug 6, 2013
How does one go about removing a recordset from a ListBox?
I have a list box that I want to toggle between using a query and an ADO RecordSet to populate the values.
Once I set the listbox .RecordSet property to the ADO.Recordset, I can't remove the values displayed in the listbox when I assign a query to the .RowSource property.
I suppose I can turn the .RowSource query to an ADO Query but I am being lazy and don't want to rewrite the query as a T-SQL query.
I previously thought the list box was pulling data from the .RowSource query but I realize I was wrong.
View 1 Replies
View Related
Jul 22, 2013
I have changed numerous features in "Current Database" under "Options", but I am unable to achieve what I need. I just need a popped form to show up when the program is initiated (no other background), meaning, I want to hide all the Runtime menu. I am able to get to the point of just the form showing up, but the form is maximized, which is not what I desire.
View 2 Replies
View Related
Feb 25, 2015
I have a Memo field that is used to be a description of a document. I don't know what the user will put in (could be anything), but it is eventually passed in a string to a query, etc.I discovered during testing that if an apostrophe is entered (Ex: This document explains how to deal with Joe's pleasant disposition.), it breaks my code. I then realized that all reserved words and characters would cause this problem.
I can get around this one just by using Replace(str, "'", "''"). However, I know there are others that will cause problems, and I don't want to end up with a string of replace statements just to fix them.
View 2 Replies
View Related
Apr 9, 2015
I posted this within the Reports as well, but since this has a little bit of VBA decided to ask this here as well.
I have a report that is created from the following query (qryTotalProjectHours). What I am trying to do is get the total hours spent on Tasks within a given time period. A given Task can we worked on by multiple individuals and hence I need to find a way to aggregate the hours spent.
Code:
SELECT TasksEntries.Project, TasksEntries.Task, Sum(TimeTracker.WorkHours) AS TotalHours
FROM TasksEntries INNER JOIN TimeTracker
ON (TasksEntries.EmployeeId = TimeTracker.EmployeeId) AND (TasksEntries.TaskID = TimeTracker.TaskId)
GROUP BY TasksEntries.Project, TasksEntries.Task
I accept the start and end dates in a form and pass it like shown below. WorkDate is a column in the TimeTracker table and is not present in any other table.
Code:
strWhere = "WorkDate BETWEEN #" & txtMgrRptStartDate & "# AND #" & txtMgrRptEndDate & "#"
DoCmd.OpenReport "rptTotalProjectHours", acViewPreview, "qryTotalProjectHours", strWhere, acWindowNormal
When the report is invoked, I get a box where it says
"Enter parameter value" for Workdate..
Is there anyway I can get rid of the prompt? I never thought you needed the column name in the SELECT statement to be able to run this.
I should add the I tried the query with the WorkDate hardcoded in there and it worked fine and returned the correct results
I have attached the cut down version of the database that I am working on.Open up the frmManagerReport Form
Leave the Employee drop down empty
Enter the start and end dates ( I have used 4/1/2015 and 4/30/2015)
Select the 3rd option "Generate Tasks by Total Hours"
click on Run
When you do that you will see the prompt come up. Enter any date and you will see the report. The report generated uses the results from the query and does not filter on the date selected in the form. This is what I have been struggling to fix since yesterday but have reached nowhere..
View 11 Replies
View Related
Aug 6, 2013
I'm trying to setup a listbox so that multiple items may be selected and removed at once. The Listbox Multi Select property is currently set to "Extended" and I have the following code on the onclick event of a command button:
Code:
Private Sub Command12_Click()
Dim i As Integer
For i = List10.ListCount - 1 To 0 Step -1
[Code]....
I have tested selecting 4 or so records on the list box and then pushing the remove button but it seems that the only record that is removed is the selected record that is furthest down on the listbox. The other selected records become unselected and must be reselected in order to continue removing records.
View 1 Replies
View Related
Jun 12, 2014
I have a table which has duplicate records so I want to write down the code so that when the user click on a button then it should remove the duplicate records from the table.
View 2 Replies
View Related
Jun 9, 2015
I'm trying to improve the dialer that i place on microsoft access forms. basically there's a command button that dials the number that is in a text box, but we have a new job that's just come in that requires numbers to be copied and pasted into the text box. these numbers have a space between the dialing code and the telephone number and i need to make the dialer check for a space and remove it before dialing.
Here's the code for the dialing buttons:-
Private Sub cmd_Dial_Click()
On Error GoTo Err_cmd_dial_Click
CT.MakeCall "8" & txt_telephone.Value & "#", "", False, "", "", False
[code]...
View 5 Replies
View Related
Jun 5, 2014
I would like to put a message on the screen for informing the user - mostly during some procedures that might take time or when, after a warning, I want to go on with the program but without action from the user.
Msgbox is obviously not the one I'm looking for as it needs customer acknowledge. Is there a solution for this task?
View 1 Replies
View Related
Aug 18, 2014
How do I remove items from a right click menu in access 2003? For example I need to remove the form view / design view button from a right click menu but i want to keep the hide/show columns button on the same menu.
View 1 Replies
View Related
Feb 20, 2014
I use the below code as part of a database which creates documents and then saves them using data from the form fields.
Every now and again one of the form fields contains a "special" character such as /,@,& and this prevents the file from saving.
Is there a simple addition to the below code to remove special characters from the file name if there is one present?
It causes all sorts of issues as many people don't realise that there has been a problem until it is too late.
Code:
objWord.ActiveDocument.SaveAs2 FileName:="C:UsersPublic" & Forms![Front Page]![Site 2 Name] _
& " " & Forms![Front Page]![Combo79] & " " & "O2" & ".doc"
objWord.ActiveDocument.Close
View 9 Replies
View Related
Nov 4, 2013
I have a simple spreadsheet:
Ref# Rev
97 b
98 c
99 c
99 e
100 c
100 b
101 a
102 b
I need to create a simple report but remove the duplicates (ex. Ref# 99,100). I need to delete the older Rev's (Ex Ref# 99 Rev C, Ref# 100 Rev B).Is this done throughRecordsets? will an SQL query do the trick?
View 7 Replies
View Related
Jan 13, 2014
I have created a form that allows the user to create an Outlook email message using a saved HTML template in VBA but the users default Outlook signature is added every time the message is sent.
how to remove the default signature from the message body?
View 2 Replies
View Related
Mar 15, 2014
I need to remove html text from a make table in access 2007. My table name is "Bad Actors Comments Column" and the column where the html text resides is "FirstOfADD_TEXT. VBA code to remove the html text?
View 3 Replies
View Related
Dec 18, 2013
I have some data in an array that I need to normalize, remove duplicates, and import.
Original Table
Every record in the array has a person, all but a few have an address, most have a phone, and some have an email.
Person----- Address ----- Phone ----- Email
Tom ----- 10 A Ln ----- 789... ----- e@a
Sue ----- 20 B Ln ----- 256... ----- _____
Sam ----- 30 C Ln ----- _____ ----- _____
Dan ----- 40 D Ln ----- 478... ----- _____
Jan ----- 40 D Ln ----- 567... ----- e@d
Stu ----- 50 E Ln ----- _____ ----- _____
Syd ----- ______ ------ 224... ----- _____
New Data Structure
I want to group the data by HouseHold; which Address will serve to define for this import.
tblHouseHold
hhID
tblAddress
adrID, hhID, Address
tblPerson
prsID, hhID, Person
tblPhone
phnID, hhID, Phone
tblEmail
emlID, hhID, Email
I've been working on a procedure to step through the recordset and add the data one record at a time so I can get rid of the duplicates.
I've tried a few approaches, but this is where I'm at now.
Code:
Dim rs As DAO.Recordset
Dim rsHH As DAO.Recordset
Dim rsPhone As DAO.Recordset
Dim rsEmail As DAO.Recordset
Dim rsAddress As DAO.Recordset
Dim rsPerson As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb
[Code] .....
View 2 Replies
View Related
Nov 19, 2013
I have a form built with multiple buttons. Once the user clicks the button and enters their parameter, I am using VBA to export the data to an excel pivot table. I would like to turn the subtotals to false so as the user clicks the check boxes in the pivot there are not any totals, subtotals, or grand totals. I am not sure how to add that to an existing query?
View 1 Replies
View Related
Oct 3, 2013
I have two tables in my Access database. Table 1 has three columns, First Name, Last Name and Phone Number. Table 2 has just 2 columns, First Name and Last Name. What I would like to do is write a VBA macro to consolidate Table 2 into Table 1 and insure any duplicate First Name-Last Name combination is removed.
Table1
Code:
F.Name L.Name Tel.N.
John Smith 12345
Larry Miller 12344
Tony Woods 12333
Table2
Code:
F.Name L.Name
Albert Black
Larry Miller
John Bush
Table1 Post-Macro
Code:
F.Name L.Name Tel.N.
John Smith 12345
Larry Miller 12344
Tony Woods 12333
Albert Black
John Bush
View 1 Replies
View Related