Hi everyone. I have the following code attached to a text box.
Private Sub txtsearch_AfterUpdate()
Me.lstsearch.RowSource = "Select [R&D ID#], [SKU#], [Project Name], [Construction level], [Manufacturer], [Hobbico Status], [R&D Work By], [Product Manager], [Desktopper]" & _
"From [Project Main]" & _
"Where [Project Name] like '*" & Me.txtsearch & "*'" & _
"OR [SKU#] like '*" & Me.txtsearch & "*'" & _
"OR [R&D Work By] like '*" & Me.txtsearch & "*'" & _
"OR [Product Manager] like '*" & Me.txtsearch & "*'" & _
"OR [Desktopper] like '*" & Me.txtsearch & "*'" & _
"OR [R&D ID#] like '*" & Me.txtsearch & "*'"
Me.lstsearch.Requery
End Sub
This code searched for matching text strings in a few different filed. It is working really well, but it would become much more helpful if instead of searching one single text string, I could enter two in the same box and it would perform the search based on matching both strings, that is, list all the records that have xxxx and xxxx in any of the fields checked.
Staff are monitored to make sure they are keeping up to date with our customers. A customer can have multiple projects going through the factory at any one time. Each customer has a record per project and a 'general' record. Ideally we would like our staff to be able to move the 'general' record when they update a project record as opposed to either having to find and then update the general record after, or forgetting and calling the customer again 2 days later!
Including a msgbox for the EnqNum seems to show the general record correctly, however being new to access I am unsure if I have the update part correct.
Code: If Me.chkMoveGen.Value = "-1" Then Dim EnqNum As Integer EnqNum = DLookup("[e_id]", "tblEnquiries", "[c_id]=" & Me.txtc_id & " and [e_status] = " & "13") DoCmd.RunSQL "UPDATE tblEnquiries " & _ " SET e_date_due=#" & Format(Me.txte_date_due, "MM/DD/YYYY") & "#" & _ " WHERE e_id= EnqNum"
I have a form that has a subform on it. The main form shows a category of furniture and has custom navigation buttons and a search text box for asset numbers and command button that runs the search. The subform shows the asset numbers associated with that furniture category, sometimes there is only one asset number, in other cases there could be 60. There is a scroll bar to scroll through the asset numbers when there are too many to see in the initial window.
The buttons all work as they should except when I search for an asset number that is part of a category that has too many asset numbers to show in the main window. When this happens the "previous" and "next" navigation buttons do not take you to the previous or next record. All of the other buttons on the form work though - you can go to the first, or the last record, and you can search for a new asset.This is the code for the search:
Code:
Private Sub cmdAssetSearch_Click() Dim rs As Object If IsNull(Me.TextAsset) Or Me.TextAsset = "" Then MsgBox "Please type in an asset number to search for.", vbOKOnly Me.TextAsset.SetFocus
[code]....
I've also attached a picture of what I mean when I say there are more asset numbers than what the window shows.
I have a table of information in Access and I was wondering what would be the best way to get the info I need out of it.
for example can I search for a specific word that could be anywhere in the table in any of the cells.
The word is 'pump' and I would also want to know if it is an inception pump or not and then I would like to see a list of clauses associated with the pump (the clauses would be in a specific column under a heading)
I have lookup table I use to return names for various "Sales Class" codes.It all works good but if there is a code that isn't in the lookup table it leaves that field empty.I want it to return the word "Unknown" for any code that doesn't have a match.Here is the SQL:
Code:
SELECT [Data1].OrderNum, SalesClasses.[Name] FROM [Data1] LEFT JOIN SalesClasses ON [Data1].[Sales Class] = SalesClasses.[Code1];
Is there anyway to use Like in queries where the user could type in more than one word?
I have a text box (search title), on a form (Search).
On after update the text box, opens a query.
The criteria in the query for the Title field is:
Like "*" & [Forms]![Search]![search title] & "*"
this works great for one word or phrase.
I would like the user to be able to type in 2 words, and have the query find all the records where the first word is in the Title, and where the second word is in the Title. And so on with 3 words or more.
I was tasked to create an application where by the user enters keywords into an Access form, and when he clicks the button, it will run the keywords against the file names stored in the table and automatically open the Word document that is the best match.
I have created a table query called Directory, which contains FPath (Z:), FName (Document1.doc) and Directory (Z:Document1.doc).
Code: Private Sub Command2_Click() Dim wrdApp As Word.Application Dim wrdDoc As Word.Document Dim filepath As String Dim strSearch As String
If IsNull(Me.txtSearch) Or Me.txtSearch = "" Then MsgBox "Please type in your search keyword.", vbOKOnly, "Keyword Needed"
[Code] ....
This is the code that I am currently using to search and open the Word documents, however, this code only manages to open Microsoft Word program without loading any documents. Also, there are no error messages when I click the submit button.
I have 5 textboxes and a multiline textbox in a form in my Access Database. I am going to type several keywords in those textboxes and I am going to type an article in the multiline textbox.
What I need to do is I want to calculate the keyword density in the article. I can do that if i know how to search the whole text in the article and count the specific word. And I want a function to count all the words in the article too.
SELECT [tblCallTracking].[PKCallID], [tblCallTracking]![PhoneNumber] & "," & [tblCallTracking]![LastName] & "," & [tblCallTracking]![FirstName] AS Expr2 FROM tblCallTracking;
I have this code in an unbound combo box. It does bring the info into the combo box properly, but when i select the record I want to use, it doesnt populate the form with the correct record.
does anyone know if it is possible to add a post code checker/search to access, if so do you know of one which works. I want to be able to bring up an addess by post code/house number in the UK
:(I have a Customer Order form with a Order Detail sub form, The problem I have is that using the productID Combo, IT shows all 6000 products, I need a way to MANUALY enter the ProductID which then will find the relevant record and fill in the rest of the fields in the Sub Detail Order Form.
All retailers have at least one distributor BUT a retailer may or may not have ordered any products.
I have created my form but the query linked to the form is having some trouble. It is only selecting those records that have ordered products. For example, if I query a retailer name only and it does not have any ordered products, it will not display. Is there a problem with the table joins? The SQL for the query is displayed here:
I would like to have a button in a form that the end user clicks and they then enter the name of the tif file they are looking for and on pressing enter the file is searched for and if found it is automatically opened up for them to see, if it is not found then a message "File Not Found" is displayed.
I Believe that I will need something like this:
Code:
Dim FS As FileSystemObject Dim filenum As Integer Dim tmp As String Dim Folder As Folder Dim subFolder As Folder Dim File As File
[Code] .....
It's when I get to this point that I've got stuck, I don't know how to structure the code required to do the search and on finding the tif file open it.
An example tif file I might search for is: 0H214_2CJ0001905.tif.
In the menu in word there is some option to view the documents 1. Normal 2. Print Layout 3….
I open the word’s document from the access I insert value from the access into word.
I asked here some question in last week and I helped so much.
My question now is:
In the document in the word I put some bookmarks. One of the bookmarks is on the header (Title of the document)
And then when I open the document its open in a “Normal” view I want to open the document in “Print Layout”
Can I open a document in “Print Layout” by code?
The problem code is: objWord.ActiveDocument.Bookmarks("nivchan").Select objWord.Selection.Text = Me.M_NIVHAN Because the Bookmark: “nivchan” is on the header.
I created a form with a ListBox and a Command Button. The users selects the values in the listbox and then click the button to create word documents. I've written VBA code to accomplish this. But it's not working properly. It opens multiple word documents but all for the same one.
Private Sub Command6_Click() Dim appWord As Object Dim varItem As Variant Dim strPathToTemplateFile As String Dim strPathToProspectiveFile As String Dim strPreferredFileName As String For Each varItem In Me.List0.ItemsSelected
My group uses VB and ODBC to query and format data on a daily basis from a central server. We may choose to add new columns from the server, but to do this means changing the code and having 40+ users of various technical skills copy and paste a new version of the database to their local machines.
What I want to do is have the Access DB call a central file that contains the VB that will extract and format the data.
I can do something similar in Excel by using Application.Run and pointing to a different Excel file with the Macro, but I haven't foudn a solution in Access. Any ideas?
How to match 4 character word or number or combination by identical 4 characters word or number or combination in one word have 10 or 15 characters.
I have to two separate tables (Table A and Table B). Table A has one column (Tag No) and Table B has about 15 columns with one column name Tag No as below
Table A
Table B
Tag No
Tag No
2009
ZZZ-2030-DC
2010
ZZZ-2010-M9P
[code]....
They're both in MS Access.I am trying to match 2 tables - columns (Tag No) with join query, but not success. I want to match 4 characters in Table-A with 4 similar characters in Table-B (Tag No) cell.What query is suitable to compare two tables.
I am looking to add multiple lines of record to a sub-form via a module activated from another linked sub-form. As an example of what I want to do: On identifying a particular type of vehicle servicing (e.g. 6000 mile service, 12000 mile service) on a service event sub-form of a vehicle form, I want to enter a list of required parts (e.g. oil filter, oil, etc) on another sub-form called "parts", that I can then edit before recording in an underlying table. Can anyone help. Thanks Steve :confused:
How do I add multiple recipients to the '.To' line in the code below?
Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(olMailItem) With MailOutLook .BodyFormat = olFormatRichText If Me.txtDepartment = "IT" Then .To = "my email" End If .Subject = "hi" .HTMLBody = "hi" .send End With
My end goal is to populate a pre-existing table in an MS Word document with records from a query. The easiest way I've found (through scouring the internet) is to start with the code below (ran during OnClick() even in Access) to get the table the same size as the recordset:
Code: Dim wDoc As Word.Document Dim wTable As Word.Table Dim wCell As Word.Cell Set wDoc = appWord.Documents.Add(strDocLoc) wDoc.Visible = True
[Code] ....
The code will shrink the table down just fine if the table has more rows than the recordset +1 (for header column). My hangup with this is the last line ("Selection.InsertRowsBelow 5") isn't executing; rows are not being added to the table. I get no errors -- it just does nothing. I set it as "Selection.InsertRowsBelow 5" arbitrarily just to see if it would even add rows, and sure enough it's not.
Wonder if you guys can help me with something. I have a table with about 1200 guests, what I want to do is to search the table base on different criteria (or combination of criteria), namely phone #, name, street name, and postal code. Not everyone has all this info, and their names aren't separted into proper lastname or firstnames (old data).
What I want to do is to be able to type in a person's first name, last name, or both (an maybe other info if the first search wasn't successful).
http://www.psynic.com/files/access.jpg
What should I do to implement this? I was thinking of running 4 different queries, and interesect them into the final query. What do you think?