Opening Form On Multiple Criteria
May 19, 2005
I have a patient form that has a subform showing the care plans. At the side of each care plan for that patient i have a button that if clicked will take you to the specific care plan. I need this to open the care plan form based on multiple criteria which is
Date (Date Field)
Care Plan Number (Numeric Field)
Patient number. (Text field)
These fields are all on the subform and will be populated.
Any ideas? :confused:
View Replies
ADVERTISEMENT
Nov 11, 2005
I have a query that searches data based on criteria input into five search fields in a form. The resulting data is then displayed in a list form. I would like to code this into the search form and do away with the formula in the query. I have tried coding this using the following formula in the open statement of the list form. However, I run into trouble when I tried multiple criterias. Can some one show me the proper way of finding data using several search criterias?
Dim StDocName as String
Dim StLinkCriteria as String
StDocName= “FormName_frm”
stLinkCriteria = "[field1]=" & "'" & Me![field1] & "'"
DoCmd.OpenForm StDocName, , , stLinkCriteria
View 3 Replies
View Related
Dec 31, 2014
I have a form "frm_PatientNew" based on table "tbl_patients", this form contains a button "cmd_NewVisit" which is supposed to do the following: opens the form "frm_NewVisit" for recording a new visit for the last recorded patient in "tbl_Patients", I found many approaches depending on DMax and Dlookup and they worked fine just if "frm_NewVisit" is bound to "tbl_Patients", but "frm_NewVisit" is bound to "tbl_Main" which acts as a container for all information (patient data, visit data,service done and service provider), so the form "frm_NewVisit" contains fields from different tables. I wonder if I should create "frm_NewVisit" as unbound form, then adding fields from different tables to it and using vba to populate "tbl_Main",
View 2 Replies
View Related
Feb 10, 2008
I have a form that has seven unbound fields named txtCityCriteria1 through txtCityCriteria7
The idea is to have the use type in up to seven cities and have this applied to the criteria of the city field in a query. This query is the datasource for a report. I know how to do a single text ....
[Forms]![frm_OpenReport]![txtCityCriteria1]
in the criteria row would do the job. But how can I do seven?
Oh and if all are left blank i need it to open another form that informs them of their mistake.
I have looked through these forums and have found several possible solutions but I can not get any to work. Any assistance would be greatly appreciated. Take it easy on me I am relatively new to this code thing. Used to do everything in macros.
View 1 Replies
View Related
Mar 24, 2005
Hello,
...I'm not sure if I'm making this question more complex or not or if it's even possible? (I would think so) Anyway...What I am trying to do is create a form in which I can input more than one criteria into a field - We will cal it txtSetValues. Then via a button open a query that will use txtCode as the criteria for searching records in a table. The
table is called: tblMASTERTABLE-EmpCount
query is called: qryEmpCount
The table currently only has two field; ORG and Name. The criteria I have in ORG is: Like [Forms]![frmEmpCount]![txtCode]
I currently can find any specific ORG just fine. I can also use the wildcard and that works fine. But how can I set it up so that I can enter in multiples... For example, I would like to find all employees that there org is either; AL001 OR AL010 OR AL100 - The wildcard will 'Almost' do it in some circumstances, but it may gather some orgs that I don't want in this list. I hope I am explaining this in an easily understood fashion?
Thanks,
---roystreet
P.S. Now I know I could just make multiple fields in the form (ie; txtCode2, txtCode3,etc) and then just add those as criteria in the query, but I was hoping that I wouldn't have to do that.
View 1 Replies
View Related
Feb 8, 2006
Hello all,
I have a form that feeds a query with information, in my query I have this:
[Company] Like [Forms]![QBF_Form]![Sales] & "*" Or [Forms]![QBF_Form]![Sales] Is Null
When I fill in a value in the field e.g. "data*"the query brings up all information with the word "data" in it.
However, when I fill in something like "data* or vent*" I don't get any query results.
How do I change the query expression above so I can search for multiple criteria in one field using "or"?
Thanks a lot for your help!
View 2 Replies
View Related
Oct 14, 2005
I was searching through here looking for a solution to the following problem:
I am building a Capacity database for work. The requirements require that users be able to sort by numerous criteria (Forecast Date, Portfolio, Market, Bucket, Month), all from a simple form that will spit out the results. Rather than creating unique queries for each combination of criteria(way too many!) or creating the SQL text in VBA, I played around until I came up with the following(which may have been done already, but I can't find it on here, so I'm not claiming to be brilliant...LOL). I have dropdowns on my form for each sort criteria-(Forecast Date, Portfolio, Market, Bucket, Month)
Then I created a query and for each criteria, I put this in:
Like (IIf(IsNull([Forms]![frmWAOFAdjustments]![Bucket]),"*",[Forms]![frmWAOFAdjustments]![Bucket]))
So if the user leaves a dropdown blank, the query simply brings back all the results from that field (Like *).
The text in bold is simply replaced with the dropdown name for each segmentation criteria. Next to each dropdown is a button that clears the dropdown box and requeries the listbox with the results(in case the user doesn't want to remove a criteria. This makes running searches for a specific number of accounts easy for the user and easy on me..lol.
Hopefully this can help someone out with a similar problem. I have learned so much from this forum, I just wanted to give something back. If anyone has any questions on this, just let me know.
View 2 Replies
View Related
Apr 19, 2013
I have a form lets call it 'Customer' and I have a table called orders how can I write 'Excel like' Countifs and sumifs formulas? I have been trying the IIf functions I believe correctly but am not getting the results expected or rather nothing at all!
What I am wanting to do is for example look at the table 'orders' and count all 'orders' which are for the 'Customer' in the active form this field is imaginatively called 'Customer Number' and 'orders' that are for simplicity 'rocks'
Basically if the client in the active form exists in the orders field count how many times they have placed an order for rocks.
View 1 Replies
View Related
Apr 17, 2014
How to open FORM which has "inner join" in source?
Code:
...
Dim idRS As DAO.Recordset, ShowIdentity
strSQL = "INSERT INTO tblZlecenia (id_zlecenia_info, DataPrzyjecia) VALUES ('" & _
ostateczne & "', " & _
Format(Date, "#mm/dd/yyyy#") & ")"
[code]....
View 5 Replies
View Related
Jul 29, 2015
I am trying to set up a query by form with multiple criteria.For the majority of the criteria I'm using the format: Like [Form]![formName].[txtInputboxName] &"*" .
I copied the Like (...) &"*" from someone else in order to allow for multiple, optional criteria, which does do the trick, however I don't understand why.
I now want to set up a criteria on my query to search for values between two input values to gives the records in the range e.g between 50 and 100 Following the above format, I want to put something that achieves this:
Between Like [Form]![formName].[txtInputboxName1] &"*" AND Like [Form]![formName].[txtInputboxName2] &"*"
with Inputbox1 being 50 and Inputbox2 being 100, however that code doesn't work and I don't know how to get around it as it keeps giving the 'incorrect syntax' error.
View 5 Replies
View Related
Nov 17, 2006
Hi,
I have the following code which i found on another thread on this forum (thanks to original author) which is attached to the On Click of a button which prints the report corresponding to the details displayed in the form.
Dim strCriterion As String
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
If IsNull(Me![ReferenceNumber]) Then
strMsg = "You cannot print a Blank Form!!."
strTitle = "Print Error"
intStyle = vbOKOnly
MsgBox strMsg, intStyle, strTitle
Exit Sub
End If
If Me.Dirty Then
Me.Dirty = False
End If
strCriterion = "[ReferenceNumber]=" & Me![ReferenceNumber]
DoCmd.OpenReport "DoC Certificate", acViewNormal, , strCriterion
This works fine, however, i need to be able to select the report based on more than 1 criteria. For example, the Reference Number can be repeated but is distinguishable from each other by an Issue Number i.e. ReferenceNumber = 93, Issue 1 or 2 etc. At present when i run the above it prints all versions of, in this case, reference number 93, which given that each report is only a single page isn't a show-stopper but it would be nice to have it working as i would like.
I have tried adding to the strCriterion line such as strCriterion = "[ReferenceNumber]=" & Me![ReferenceNumber] and "[IssueNumber]=" & Me![IssueNumber] but no joy. I have tried bracketing the whole line and variations thereof, again no joy.
Can anybody tell if what i am attempting to do is possible and if so how do i go about it?
I have tried the above coding using MasterID which is the Autonumber PK but it produces an "Enter Parameter Value" box for MasterID. Obvioulsy if i can get it to work for the Autonumber then my problem goes away but i can't seem to figure out why it works for Reference Number (Number) and not MasterId (Autonumber)?
Regards
Alan
View 5 Replies
View Related
May 29, 2014
I have a form where varying layers of information can be entered. In some cases, a user may know all information or only part. If i tie the query to the form, each field has to be populated for it to work. how do i set the query up to effectively use the information available and not require all information?
I have tried setting VBA code as follows:
If Me.Combo1 = Null Then Me.Combo1 = "*"
However, when i do this, it updates the form field with an asterick/wild card but does not include in query. yet, when i update the form fields with data (not asterisk/wild card) the query runs.
View 13 Replies
View Related
Nov 26, 2013
I need to create a query that has multiple criteria selected from a form For example. I will always have the customer name but then the user might also choose any one or more of the following, start date, end date, number etc
I have tried to create a select query and added the customer form element to the criteria but I am not sure how to do the rest because it will always have at least one more criteria but I am not sure which one and it may have up to 5 more criteria.
View 5 Replies
View Related
Apr 7, 2014
I have a Form opening from Access Options. I would like to close this Form using the Timer. The following is the code I have used but it is not working.
Private Sub Cover_Page_Form_Load()
OpenTimer = Timer
End Sub
Private Sub Cover_Page_Form_Timer()
If (Timer - OpenTime) = 5 Then DoCmd.Close acForm, "Cover_Page_Form", acSaveYes
End Sub
Next question. If I can get this to work can I then use a DoCmd to open new Form within the code above or do I need a new process.
View 5 Replies
View Related
Jan 4, 2006
I am trying to put together an form to be used in an academic administration database.
Ideally, I would like to create a form that will allow a user to select criteria and get a list of all students fitting that criteria.
For example:
Show me all a) all Economics majors with b) 30-50 Credits who c) have not taken English 101.
All of this data could be compiled into one query, but I would like to create a form that will allow a user to select what data he or she would like to see.
(Maybe they only want to see graduates)
I hope this makes sense.
And I hope someone can help point me in the right direction.
Thank you!
View 2 Replies
View Related
Sep 29, 2014
I have a user form with six different dropdown boxes. I would like to create a query that gets its criteria from users selecting values from one or more of these boxes.
I have tried:
[forms]![frmName]![comboboxname] or [forms]![formName]![comboboxname] is null
in the corresponding query fields and get a "query is too complex" error message, even when only selecting one criteria.
What am I doing wrong?
View 5 Replies
View Related
Nov 14, 2012
My form-based search mechanism uses controls to set the parameters for the query data source.
I have one field call quantity in stock. I could you a Between and And method to allow the end user to input the stock quantity they want.
HOWEVER, i would love it for the user to first select the Comparison Operator (e.g. > , <, >=, <=) from a combo box and then in an adjacent text box, enter the quantity.
The expression i entered in the query goes something like this.... Forms![frmSearch]![cboRange] & [Forms]![frmSearch]![txtQuantity]
When i try and run this, i get the message "THe expression is too complex to be evaluated".
View 5 Replies
View Related
Feb 12, 2006
Hello everyone,
I have a problem with opening forms.I have situation with 8 forms (small ones!) which must be open based on values in ComboBox1 and ComboBox2.
Can I do it with Select case (DoubleClick event), and how?
THANK YOU IN ADVANCE,
View 4 Replies
View Related
Aug 13, 2015
I have Table for rooms called Rooms, and the data in the table is roomNumber which is in the format Letter and two Digit number, so A01 would be dorm building A and room building 1, and I then have a seperate row named roomType that is either VIP or Semi Private.
Now I am creating a form where a worker will put in there scheduledCheckin date and scheduledCheckout date and it will be written to the Bookings table. I would like this form however to take the dates they have put in, as well as room type (Semi-Private or VIP, and assign them an available room that isn't booked at all in that range) or list all available rooms for that range of time and they could then just select the room. I would rather it automatically assigns an available room based on room type though because this check in system is going to have about 500 rooms.
I've attached a link for what I have so far. I know how to make a query to list anyone who has booked rooms over that date, but need one for just preventing booking the same room.
[URL] .....
View 3 Replies
View Related
Feb 7, 2005
Hi folks,
I have a form with a regular save record command button, however I also want to add in an action to open a second form based on information stored within the form.
So users may be directed to Form.alpha or Form.beta depending on their data.
Can any one help?
View 1 Replies
View Related
Sep 30, 2004
The posting in archive t-31918 was very helpful and almost does the trick. I have a subform with gifttype that has only giftID and gifttype. There are four different gift types and I need a subform to open in a specific location, as a subform. The code given by the archive (my version):
Private Sub Gifttype_AfterUpdate()
If Me.[Gifttype] = "restricted/unrestricted" Then
DoCmd.OpenForm "frmgift1"
ElseIf Me.[Gifttype] = "planned gift" Then
DoCmd.OpenForm "frmplannedgift"
End If
...
Opens what I want as subform as a regular form.
How can I get the correct subform to populate a certain area on the master form?
Thank you!
Pat Wright
View 1 Replies
View Related
Jan 4, 2014
I need to count records based on multiple criteria from two different tables. I have two tables (i.e. "tblTasks" and "tblTaskHistory"). The tables have a one-to-many relationship based on the "TaskID" field. "tblTasks" has a field called "AssignedTo" and "tblTaskHistory" has a field called "TaskStatus". I need to know how many tasks have been "reopened", the "reopened" status is located in the "TaskStatus" field in "tblTaskHistory". I need this count against a unique listing of employees which can be found in the "AssignedTo" field in "tblTasks".
View 4 Replies
View Related
Jun 28, 2006
Hi Folks,
Hoping someone may be able to point me in the right direction.
I've got several databases used for different tasks, in which I just added an hyperlink to them from a front end database. All my team could access any of the data bases at once. It was using the WINNT/MS OFFICE mdw file.
Since my last question, I've now managed to set up a MS Workgroup Administrator file, which is on a shared drive. Everyone has joined this workgroup, and when people logon it now greets them with their name and records their name against any tasks. Thanks to everyone for their help with setting this up.
But since I created this new workgroup, we can't access more than one database at at time. It comes up saying 'mdw file is in use'. However, one person in the office can. I've looked at all the setups for individuals, and can't see any difference between ours & this one individual.
Am I missing something obvious ?
Cheers
Karen
View 4 Replies
View Related
May 22, 2006
We have an access Database stored on a server that until now was only ever accessed by the one user. Now more users need to access it at the same time. However when a second user trys to open the database the error message "File Already in use appears". I did not create this database so have no idea how it was set up. I think it may have something to do with being opened up exclusively. Is there anyway around this by creating a short cut or changing any kind of propertties?
View 2 Replies
View Related
Apr 14, 2015
I have been tasked with creating a tool to analyse mobile phone bill data and present the analysis, and our recommendation, to a customers. Being new to Access (other than basic tuition) this has been a slow uphill task, which is finally nearing completion, however there is a problem which I have not yet been able to overcome.
The requirement is for the DB to open first on a splash screen (lets call it Form A) with fancy picture where our customer is selected from a combo box, the customer is then telephoned, a linked computer screen is established and our staff then click "Go" to proceed to a second form (Form B) showing an account overview and more details.
The problem I have is when "Go" is clicked, the second form loads via on click event, and even populates the correct customer in its combo box. Unfortunately that is as far as it gets - the combo does not look up the information. The customer needs to be selected again for the subforms and subreports to load with the customer overview. To clarify, form B just sits there blank until the customer is re-selcted from the combo box in form B.
View 9 Replies
View Related
Sep 15, 2005
I created a form that allows the user to choose the criteria that they want to see on a report using =Forms!formname!controlname in my query. It works great but I want to also allow the user to choose nothing and return all records instead of limiting them to choose just one type of record. Is this possible? Before I created the form my query had the [Enter parameter] on one criteria line and [Enter parameter] Is Null on the next criteria line and that was working great for my use but I need to create a simple form for other users.
View 1 Replies
View Related