In my form, I have a combo box with one of three options (cash, check, reimbursement). If the user chooses check, I want a text box to become visible, so the user may input the check number.
I thought I could use another invisible text box to store the value of the combo box and then in the code put:
Private Sub Text64_AfterUpdate()
If Text64 = "Check" Then
Me.Check1.Visible = True
Else
Me.Check1.Visible = Refresh
End If
Me.Refresh
End Sub
Text64 is holding the value of the combo box
Check1 is the text box where I want the user to put the check number.
I have a combobox on my form called TypeOfBusiness, with fields including Corporation, Education, Industry, Non-Profit. In order to make a second combobox called IndustryClassification appear when Industry is selected from the TypeOfBusiness combobox, I have used the following code:
Code: Private Sub Form_Current() If Me.TypeOfBusiness = "Industry" Then Me.IndustryClassification.Visible = True Else Me.IndustryClassification.Visible = False
[Code] .....
It works just fine. However, when a user selects both, say, Industry and Education, the IndustryClassification combobox will not appear. What code I can use to ensure the IndustryClassification box will appear regardless if another box is checked in addition to Industry? I am wondering if it has to do with the Column attribute.
I have a Main Form with a Sub-Form, the sub-form is base off a query. on the sub-form i have 8 controls, one of them is "Status' and "Process" and "Review" My Main Form have a Refresh command that refreshes the data in the sub-form.
What i am trying to do is make the "Process" Control only visible is "Status" is a certain status and "Review" visible if "Status" is something else. what i have done works correctly On Open. I run into and issue on the refresh command. I get Run-time error '2165' "You can't hide a control that has the focus"
Code: If Forms!Main_Form.[Name subform]!Status = "Ready" Then Forms!Main_Form.[Name subform]!Process.Visible = True Forms!Main_Form.[Name subform]!Review.Visible = False ElseIf Forms!Main_Form.[Name subform]!Status = "Reviewing" Then Forms!Main_Form.[Name subform]!Review.Visible = True Forms!Main_Form.[Name subform]!Process.Visible = False End If
I have done similar with a main form and making sub-form visible or not based on a control on a main form and that has worked perfectly. I am not sure how the control is getting focus and cause the error.
I have a form with four subforms set up in a tabs on the form. In the subforms I have a copuple of command buttons which enable/make visible fields when they are clicked (see previous posts but for eg) - if a height and a weight are added in two separate boxes a calculation is done and then a command button pressed to make visible the (label) which shows the mass index the patient falls into. My problem is that the label is then retained so if I click out of the form and re-enter with a new patient then the height and weight boxes are clear but the label from the previous patient remains.
I tried to put the code Private Sub Form_Load() If PtWeight = Null And PtHeight = Null And Text60 = Null Then Label106.Visible = False Label101.Visible = False Label177.Visible = False Label122.Visible = False Label123.Visible = False End If End Sub in both the open and on load event of the main form (not the subform) but it doesn't help. Any ideas?
(When should code be put on the main form and when on the subform?)
I want to set up a 'keyword search' facility on my dbase. I would like the user to enter a keyword in a dialog box and for this to then open my main FRMContractInfo form with a recordset that shows all the records where this word appears in any or each of four fields (Summary, Methodology, Lessons, Successes). I am a bit confused about how I should approach this, can someone offer me some advice?
Do I:
a) set up a Query that references the text box on the dialog box and code it as the open form's recordset b) write the SQL for the form in the code?
Or are neither of these approaches correct? I've tried both and neither seem to work - but I think I've got my syntax all wrong because of trying to use Like and the wildcard (*) character...
:confused: I am trying to establish a relationship between two tables in a query. One table includes a keyword field which I would like link to a field the second table that contains the keyword as part of a longer string of text. For example the keyword is "rose" and a field in the second table may contain "my hobby is to grow roses" I can filter using *rose* with no problem and can use SQL to build a query but I get a "Query to complex" error and both the filter and SQL are tideous.
I'm stumped and would appreciate suggestions for any other way to approach this seemingly simple problem.
I've got this query whereby i would like to find the address information about people by a keyword search on either their name or their quickname which currently looks like this:
SELECT Tbl_Addresses.* FROM Tbl_Addresses WHERE ((((Tbl_Addresses.Name)OR(Tbl_Addresses.Quickname) ) Like "*" & [Enter a Name] & "*"));
However this doesn't return any results? it works if i search for just the Tbl_addresses.Name or the Tbl_Addresses.Quickname but not for both? does anyone know how to fix this problem?
I hope someone can help me. I am using Access 2003 to create a database to keep a track of projects in my craft magazines.
I have a table that gives the magazine name, issue no, project name, page no and keywords. When I enter my data I will use various keywords to describe the project. For example, for a football card for a teenage boy I would use keywords such as football, boy and teenager.
What I need to be able to do is have a query based on this table that if I search for "football" it will pull up all records where I have used football as one of the keywords.
In my current query I can do this providing "football" is the only keyword I have used, but if I have used more than 1 keyword in my table then my query will not show any results.
Is there any way I can do this?
Hope you can understand what I am asking, and if someone can help, I would appreciate simple instructions as I am not very experienced with access
HI, Im trying to create a keyword search based on the data in several fields. The below command works well for searching one field, but I want to search several at once. Any help would be great. Thanks!
What you need is a parameter query. In the criteria space in the desired field in your query, put the following: Like "*" & [Search by word:] & "*"
When you run the query, a message box will pop up that says "Search by word:", and then you could type in "mountain" or "goat" or even just type in one or two letters. To make it more/less specific, play around with those wildcards.
I would like to have a search box in which someone can type anything and it will search through a few tables to see if this word appears, and then return information from that record so I know who it belongs to. I have a query written that has all of the fields from all of the tables that I want the search to cover, but now I am having trouble connecting a button to the query so that it runs the query and puts the word as the "Like" criteria. I can make the button run the query, but I didn't know if I have to put Like * &[TextBoxName] & * in the criteria of each of the possible fields? I would appreciate your help with this. Thanks:)
Hello all, once again I would very much appreciate anyones help on what may be quite a simple issue,, my problem (or one of!!) is as follows: I have a table that contains approx 3k records I wan to run a query that allows me to select a certain number of fields with a group. From this I mean, I have all records grouped by discipline, firstly its easy for me to determine the discipline I require (I do this in the design view by adding the discipline number in the criteria row.) next I want to find a certain number of the records that are within my chosen discipline,, the records I wan to see all contain the word ‘alignment’. I tried entering ‘alignment’ on the criteria row but that didn’t get me anything,, the field that contains the word alignment also has many other words listed… Please help Many thanks Jon
I am a relatively novice access user with a question about a query I have built. The query is a parameter query that takes its query values from a form.
I have the query constructed at the moment so the user can search and any combination of fields using a date range, and three drop downs.
One of the fields in the table that I am querying is a text "Subject" field. I would like to add a keyword search upon this field into my existing query, as such I added a text box into my form, in which the user can type a keyword to search upon.
However, when I added the following criteria to the field in my query: Like "*" & [Forms]![frm_find_log_entry]![Subject] & "*" And then tried typing anything into my keyword search box on my form and run my query, I am returned with all results, rather than just results with the search words.
I have read a few strings on this subject. One from 2002 seemed to be on the right track but I was unable to understand it well enough to implement the suggested solution.
Any insight that could be provided on this subject would be greatly appreciated.
As shown in the attached database, I have a multiple criteria query with a front end (see frmIssue). I am trying to add a keyword search on the field 'Issue' by having an unbound textbox in frmIssue and linking it with a 'Issue' field in the query 'MyQuery'.
An example search would be looking for an issue with the keyword 'misfiring' in project 'A'.
However, having tried the Like expression on the field 'Issue' a few times, I'm still having trouble making it work. Any suggestions would be greatly appreciated!
In the bit of code below how do I set QTY to be right aligned using the Format keyword? Example of the output I am trying to get with my output strings is
1600.00 ***1.00 **15.00 *100.00
I've messed about with the format function but no quite there yet.
code: Set rs2 = CurrentDb.OpenRecordset("qry_test") With rs2 Do Until .EOF StrBody = StrBody & vbCrLf & _ "" & !Item & "" & !Desc & " " & Format(!QTY, "##0.00") & " " & !PRICE & ""
I have search the web and came across something pretty similar to what am looking for (URL...), unfortunately this database sample does not work with my Access 03, so I cant really play with it.
What I want to do is have 3-4 Paths save on my form to folders on our office server, this is were we keep client files. I like to have the ability to search for individual folders by either client ID or name or even partial name if possible too, knowing that it may display more than one folder for the employee to pick and open.
Does anyone know how to do a keyword search in MS access so in a knowledge tree with 100 of records with a few keywords in one of the main fields i.e. symptoms i can reduce the amount of records to go throught
I am trying to get a multiple keyword search query working.... the single search is working however when i use the Multiple Keyword search the data sheet does pop up but no matter what i put in i just get a blank table and under ID it says "NEW"
The Keywords Column has a bunch of keywords separated by commas on each row. Sometimes there will be the same keywords on different rows under the keyword column... and i want it to return any rows that have 1 or more of the keywords in it or if it is null just to return them all....... this is the statement I am trying...
SELECT Sea.ID, Sea.Category, Sea.Title, Sea.Author, Sea.Organisation, Sea.Date, Sea.Keywords, Sea.Reference FROM Sea WHERE (((InStr([Keywords separated by commas,Blank=All],[Keywords]))>0 Or (InStr([Keywords separated by commas,Blank=All],[Keywords])) Is Null));
I am trying to perform some keyword searches of a text field. My preferred option would be to hold all the keywords in a separate table and then use something like
SELECT * FROM Text Table, Keywords Table WHERE (((InStr[Text Table].[Text],[Keywords Table].[keywords])) > 0 ));
This works and returns anything which has the string from the keyword table, however I wanted to look for whole words only. I can do this in SQL using a regular expression along the lines of [!a-z] keyword [!a-z] which only finds the string where it has no letters directly either side of it.
What I would like to do is combine the two methods so I hold my keywords in a table and then use them with the reg ex to find whole words only.
I'm relatively new to Access 2010. I have an excel spreadsheet that I've converted into an access table for the purposes of creating a user friendly form for the end user to search for relevant criteria to retrieve a list of records that fit the requests. There are two main search functions: unbound keyword search (90+ keywords), and either a series of checkboxes or one list box that lists specific countries/regions matched in a column (columns, as I will get to shortly). The region selection is bound by a selection of 15 countries.
The key is each record can correspond to more than one country. This, one record can have "Belgium, Germany, brazil" and the next record can just have "brazil". Thus if someone selects brazil, the query must retrieve the Belgium Germany brazil record in addition to the record that covers just brazil. I've tried to do this with a concatenated column that list all countries and a text box search, I've tried to do this with individual checkbox columns for each country with checkboxes in the search form...and I can't get it to work. I don't fully understand the criteria to set for checkboxes or list boxes. What would be the best way to build this form, an how?